Sail E0 Webinar
Question


What is the output of the program


#include<stdio.h>
int main ()
{
struct emp
{
char name [20] ;
int age;
float sal;
};
struct emp e = {"Tiger"};
printf ("%d, %f\n", e.age, e.sal);
return 0;
}
Options:
A .  0, 0.000000
B .  Garbage values
C .  Error
D .  None of above
Answer: Option A

When an automatic structure is partially initialized remaining elements are

initialized to 0(zero).



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers