Point out the error in the program?
typedef struct data mystruct;
struct data
{
int x;
mystruct *b;
};
What will be the output of the program given below in 16-bit platform ?
#include<stdio.h>
int main()
{
enum value{VAL1=VALVALVALVALvar;
printf("%d\n", sizeof(var));
return}
Point out the error in the program?
struct emp
{
int ecode;
struct emp *e;
};
Which of the following statements correct about the below program?
#include<stdio.h>
int main()
{
struct emp
{
char name[25];
int age;
float sal;
};
struct emp e[2];
int i= for(i=i<i++)
scanf("%s %d %f", e[i].name, &e[i].age, &e[i].sal);
for(i=i<i++)
scanf("%s %d %f", e[i].name, e[i].age, e[i].sal);
return}
Which of the following statement is True?
Which of the following statements correct about the below program?
#include<stdio.h>
int main()
{
union a
{
int i;
char ch[2];
};
union a u1 = {512};
union a u2 = {2};
return
}
| 1: | u2 CANNOT be initialized as shown. |
| 2: | u1 can be initialized as shown. |
| 3: | To initialize char ch[] of u2 '.' operator should be used. |
| 4: | The code causes an error 'Declaration syntax error' |
Point out the error in the program?
#include<stdio.h>
#include<string.h>
void modify(struct emp*);
struct emp
{
char name[20];
int age;
};
int main()
{
struct emp e = {"Sanjay", 35};
modify(&e);
printf("%s %d", e.name, e.age);
return}
void modify(struct emp *p)
{
p ->age=p->age+}
The '.' operator can be used access structure elements using a structure variable.
Point out the error in the program?
#include<stdio.h>
int main()
{
struct a
{
float category: char scheme: };
printf("size=%d", sizeof(struct a));
return}
What will be the output of the program ?
#include<stdio.h>
int main()
{
enum days {MON=-TUE, WED=THU, FRI, SAT};
printf("%d, %d, %d, %d, %d, %d\n", ++MON, TUE, WED, THU, FRI, SAT);
return
}
What will be the output of the program ?
#include<stdio.h>
int main()
{
enum status {pass, fail, absent};
enum status studstudstud
stud1 = pass;
stud2 = absent;
stud3 = fail;
printf("%d %d %d\n", studstudstud3);
return
}
Which of the following statements correctly assignsto month using pointer variable pdt?
#include<stdio.h>
struct date
{
int day;
int month;
int year;
};
int main()
{
struct date d;
struct date *pdt;
pdt = &d;
return}
Point out the error in the program in 16-bit platform?
#include<stdio.h>
int main()
{
struct bits
{
int i: }bit;
printf("%d\n", sizeof(bit));
return}
Union elements can be of different sizes.
Point out the error in the program?
struct emp
{
int ecode;
struct emp e;
};
What will be the output of the program ?
#include<stdio.h>
struct course
{
int courseno;
char coursename[25];
};
int main()
{
struct course c[] = { {"Java"},
{"PHP"},
{"DotNet"} };
printf("%d ", c[1].courseno);
printf("%s\n", (*(c+2)).coursename);
return}
What will be the output of the program ?
#include<stdio.h>
int main()
{
int i=j=
printf("%d, %d, %d\n", i|j&j|i, i|j&j|i, i^j);
return
}
Which of the following statements correct about the below code?
maruti.engine.bolts=25;
Point out the error in the program?
#include<stdio.h>
int main()
{
union a
{
int i;
char ch[2];
};
union a z1 = {512};
union a z2 = {2};
return}
A structure can contain similar or dissimilar elements