5 years ago in C Structures And Unions

What is the output of following C code?
main()
{
struct emp
{
char name[20];
int age;
float sal;
};
struct emp e ={"Tiger"}
printf("%d%d%f",e.age,e.sal);
}

[A] Error
[B] Garbage Collection
[C] 0 0.000000
[D] 1 0.000000
Loading...
Next Question

Overall Stats

Attempted 232
Correct 33
Incorrect 92
Viewed 107

Answers

Guest
Guest
Ram Khatkar - 5 years ago

your answer is very wrong a is the right answer because compilation error will occur for declaration syntax error when we deal with programming languages its mandatory to keep an eye on errors hence Answer according to this question should be A OR there should be a statement terminator after
struct emp e = { "tiger" } ;

Vallamkondu Sudeshna
Vallamkondu Sudeshna - 2 weeks ago

Vallamkondu Sudeshna from Hyderabad, India is saying 0 0.000000 is correct answer

Kriti Goel
Kriti Goel - 2 months ago

Kriti Goel is saying Garbage Collection is correct answer

Rajeev Nathani
Rajeev Nathani - 3 months ago

Rajeev Nathani from Jalandhar, India is saying 0 0.000000 is correct answer

indhuja indhuja
indhuja indhuja - 4 months ago

indhuja indhuja from Erode, India is saying Garbage Collection is correct answer

Related Questions

A -> B is syntactically correct if?

  • [A] a and b are structure
  • [B] a is a structure and b is a pointer to structure
  • [C] a is a pointer to structure and b is a structure
  • [D] a is a pointer to structure in which b is a field

Which operator is used to connect structure name to its member name?

  • [A] dot operator(.)
  • [B] logical operator(&&)
  • [C] pointer operator(&)
  • [D] Arrow operator(->)

Which of the following comment about Union is false?

  • [A] Union is a structure whose members share same memory area
  • [B] The compiler will keep track of what type of information is currently stored
  • [C] Only one of the members of union can be assigned a value at particular time
  • [D] Size allocated for Union is the size of its member needing the maximum storage

For accessing a structure element using a pointer,you must use?

  • [A] Pointer operator (&)
  • [B] Dot operators(.)
  • [C] Pointer operator(*)
  • [D] Arrow operator(->)