Question
#include<stdio.h>
struct values
{
int i;
float f;
};
void main()
{
struct values var={555,67.05501};
printf("%2d %.2f",var.i,var.f);
}
What will be output if you compile following c code ?
#include<stdio.h>
struct values
{
int i;
float f;
};
void main()
{
struct values var={555,67.05501};
printf("%2d %.2f",var.i,var.f);
}
Answer: Option C
Was this answer helpful ?
The members of a structure variable can be assigned initial values in much the same manner as the elements of an array. The initial values must appear in order in which they will be assigned to their corresponding strucutre members, enclosed in braces and separated by commas.
Was this answer helpful ?
Submit Solution