In the following code what is 'P'?
typedef char *charp;
const charp P;
Answer: A
No answer description available for this question.
Enter details here
What will be the output of the following C code?
#include
int main()
{
typedef union a
{
int i;
char ch[2];
}hello;
hello u;
u.ch[0] = 3;
u.ch[1] = 2;
printf("%d, %d", u.ch[0], u.ch[1]);
return 0;
}
Answer: B
In the code shown above, we have defined hello, which is the instance variable of a union (a) using typedef. On the execution of the code shown above, we obtain the output: 3, 2
Enter details here
What is the output of this C code?
typedef struct p
{
int x, y;
}k;
int main()
{
struct p p = {1, 2};
k k1 = p;
printf("%d\n", k1.x);
}
Answer: B
No answer description available for this question.
Enter details here
What will be the output of following program ?
#include < stdio>
int main()
{
typedef int AAA,BBB,CCC,DDD;
AAA aaa=10;
BBB bbb=20;
CCC ccc=30;
DDD ddd=40;
printf("%d,%d,%d,%d",aaa,bbb,ccc,ddd);
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
In a C program, following variables are defined:
float x = 2.17;
double y = 2.17;
long double z = 2.17;
Which of the following is correct way for printing these variables via printf.
Answer: A
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
int main()
{
enum color{red, green, blue};
typedef enum color mycolor;
mycolor m = red;
printf("%d", m);
return 0;
}
Answer:
Enter details here
What will be the output of the following C code?
#include
typedef struct p
{
int x, y;
}k;
int main()
{
struct p p = {1, 2};
k k1 = p;
printf("%d\n", k1.x);
}
Answer: B
No answer description available for this question.
Enter details here
Assuming int size is 4 bytes, what is going to happen when we compile and run the following program?
#include “stdio.h”
int main()
{
printf(“GeeksQuizn”);
main();
return 0;
}
Answer: D
No answer description available for this question.
Enter details here
In the following code snippet can we declare a new typedef named ptr even though struct employee has not been completely declared while using typedef?
typedef struct employee *ptr;
struct employee
{
char name[20];
int age;
ptr next;
}
Answer: A
No answer description available for this question.
Enter details here
What is typedef declaration?
Answer: C
No answer description available for this question.
Enter details here