Question
#include<stdio.h>
struct
{
int i;
float f;
}var;
void main()
{
var.i=5;
var.f=9.76723;
printf("%d %.2f",var.i,var.f);
}
What will be output if you compile following c code ?
#include<stdio.h>
struct
{
int i;
float f;
}var;
void main()
{
var.i=5;
var.f=9.76723;
printf("%d %.2f",var.i,var.f);
}
Answer: Option D
Was this answer helpful ?
Though both <struct type name> and <structure variables> are optional, one of the two
must appear. In the above program, <structure variable> i.e. var is used. (2 decimal places or)
2-digit precision of 9.76723 is 9.77
Was this answer helpful ?
Submit Solution