Q:

What is the output of the below C program?

0

What is the output of the below C program?

#include <stdio.h>
int main()
{
    int pos = 14;
    float data = 1.2;
    printf("%*f",pos,data);
    
    return 0;
}

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

The output of the above code will be 1.200000 with 6 space.

Explanation:

Here 1.200000 is printing with, 6 spaces, because by giving * in printf we can specify an additional width parameter, here ‘pos’ is the width and ‘data’ is the value. if the number is smaller than the width then rest is filled with spaces.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Differentiate between a constant pointer and point... >>
<< What is the meaning of the below declarations?...