Question Detail

Difference between structure and union is

  • We can define functions within structures but not within a union
  • We can define functions within union but not within a structure
  • The way memory is allocated
  • There is no difference
Similar Questions :

1. A variable in c

  • must have a valid datatype
  • can't have a name same as keyword
  • must have a name starting with a character
  • All of above

2. Can getch() be used to echo the input

  • Yes
  • No

3. printf() belongs to which library of c

  • stdlib.h
  • stdio.h
  • stdout.h
  • stdoutput.h

4. What will be output of
#include
void main()
{
char test =`S`;
printf("\n%c",test);
}

  • S
  • Error
  • Garbage value
  • None of above

5. Due to variable scope in c

  • Variables created in a function cannot be used another function
  • Variables created in a function can be used in another function
  • Variables created in a function can only be used in the main function
  • None of above
Read more from - C Programming Questions Answers - Chapter 1