what would be the output of the follwing

struct st
{
char name[20];
int i;
float f;

};
main()
{
struct st emp = {"forum"};
printf("%d %f",emp.i,emp.f);

}

Answer Posted / maruthi

Answer:0,0

Because if 1 element is initialised in structure or array
the remaining elements are initialised to 0 by default.

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where static variables are stored in memory in c?

527


write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3

1646


Why c language is called c?

573


please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com

1333


Can you please compare array with pointer?

621






What is a lvalue

668


Explain how can I make sure that my program is the only one accessing a file?

635


What are the different types of errors?

648


What is #line used for?

584


How do you print an address?

752


What is the function of this pointer?

681


Which is better malloc or calloc?

656


Why we use stdio h in c?

588


How is a pointer variable declared?

598


What’s the special use of UNIONS?

663