Top

Structures, Unions, Enums

91.

What is the correct syntax to declare a function foo() which receives an array of structure in function?

Answer: A

No answer description available for this question

Enter details here

92.

What will be the output of the following C code?

main()
{
    enum resut {pass, fail};
    enum result s1,s2;
    s1=pass;
    s2=fail;
    printf("%d",s1);
}

 

Answer: A

The code shown above results in an error, stating : storage size of s1 and s2 unknown. There is an error in the declaration of these variables in the statement: enum result s1,s2;

Enter details here

93.

Which operator connects the structure name to its member name?

Answer: C

No answer description available for this question

Enter details here

94.

#include 

typedef enum{
    Male, Female
}SEX;

int main()
{
  SEX var = Male;
  SEX var1 = Female;
  printf("%s %s",var, var1); 
  return 0;
}

 

Answer: C

No answer description available for this que

Enter details here

95.

Which operator connects the structure name to its member name?

Answer: C

No answer description available for this question

Enter details here

96.

What will be output for the following code?

Answer: A

The code shown above results in an error, stating : storage size of t1 and t2 unknown. There is an error in the declaration of these variables in the statement: enum test1 t1,t2;

Enter details here

97.

#include "stdio.h"

typedef enum{
    Male=5, Female
}SEX;

int main()
{
  SEX var = Male;
  SEX var1 = Female;
  printf("%d %d",var, var1);
  return 0;

}

 

Answer: D

No answer description available for this question

Enter details here

98.

#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;
}

 

Answer: D

No answer description available for this question.

Enter details here

99.

What will be the output of the following C code?

#include
enum sanfoundry
{
    a=1,b
};
enum sanfoundry1
{
    c,d
};
int main()
{
    enum sanfoundry1 s1=c;
    enum sanfoundry1 s=a;
    enum sanfoundry s2=d;
    printf("%d",s);
    printf("%d",s1);
    printf("%d",s2);
}

 

Answer: D

The output of the code shown above is 101. This code shows that it is possible to store the symbol of one enum in another enum variable.

Enter details here

100.

What will be output for the following code?

Answer: A

No answer description available for this question

Enter details here

Loading…
Tags: Structures, Unions, Enums Questions and Answers || Structures, Unions, Enums MCQ Questions and Answers || Structures, Unions, Enums GK Questions and Answers || Structures, Unions, Enums GK MCQ Questions || Structures, Unions, Enums Multiple Choice Questions and Answers || Structures, Unions, Enums GK || GK on Structures, Unions, Enums || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming