• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

C Structure & Union

Question 21

The following C declarations 
 

C
struct node
{
   int i;
   float j;
};
struct node *s[10] ;

define s to be
 

  • An array, each element of which is a pointer to a structure of type node
     

  • A structure of 2 fields, each field being a pointer to an array of 10 elements
     

  • A structure of 3 fields: an integer, a float, and an array of 10 elements
     

  • An array, each element of which is a structure of type node.
     

Question 22

Choose the correct output from the options given below:

C
#include‹stdio.h›
int main()
{
    struct site
    {
        char name[] = \"GeeksQuiz\";
        int no_of_pages = 200;
    };
    struct site *ptr;
    printf(\"%d \", ptr->no_of_pages);
    printf(\"%s\", ptr->name);
    getchar();
    return 0;
}
  • 200 GeeksQuiz

  • 200

  • Runtime Error

  • Compiler Error

There are 22 questions to complete.

Last Updated :
Take a part in the ongoing discussion