What will be the size of the following structure?
struct demo{
int a;
char b;
float c;
}
Answer: A
No answer description available for this question
Enter details here
Which of the following operators can be applied on structure variables?
Answer: B
No answer description available for this question.
Enter details here
Number of bytes in memory taken by the below structure is
#include
struct test
{
int k;
char c;
};
Answer: A
Number of bytes in memory taken by the below structure is Multiple of integer size
Enter details here
What will be the output of the following C code?
#include
#define MAX 4
enum sanfoundry
{
a,b=3,c
};
main()
{
if(MAX!=c)
printtf("hello");
else
printf("welcome");
}
Answer: C
The output will be welcome. The value of the macro MAX is 4. Since 4 is equal to the value of c, welcome is printed.
Enter details here
What will be the output of the following C code if input given is 2?
#include
enum day
{
a,b,c=5,d,e
};
main()
{
printf("Enter the value for a");
scanf("%d",a);
printf("%d",a);
}
Answer: D
The code shown above results in an error. This is because memory is not allocated for constants in enum. Thereore ampersand(&) cannot be used with them. Also, a value has already been assigned to ‘a’, which cannot be changed.
Enter details here
How will you free the allocated memory ?
Answer: B
No answer description available for this question
Enter details here
The above C declaration define 's' to be
struct node
{
int i;
float j;
};
struct node *s[10];
Answer: A
No answer description available for this question.
Enter details here
What is the output of this program?
#include
void main()
{
struct demo{
char * a;
int n;
};
struct demo p = {"hello", 2015};
struct demo q = p;
printf("%d", printf("%s",q.a));
}
Answer: C
No answer description available for this question
Enter details here
What will be the output of the program if it is executed like below?
cmd> sample
/* sample.c */
#include
int main(int argc, char **argv)
{
printf("%s\n", argv[argc-1]);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
Members of a union are accessed as________________.
Answer: C
No answer description available for this question
Enter details here