Total Fifteen Questions. Each Carry 2 Marks.
Total Time 30 Minutes.
Time limit: 0
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Results
Quiz complete. Results are being recorded.
Results
0 of 15 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Categories
- Not categorized 0%
-
If you score less than 26 marks please watch the videos and take the test again after a week.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- Current
- Review
- Answered
- Correct
- Incorrect
-
Question 1 of 15
1. Question
1) What is the output displayed by the below code?
#include<stdio.h>
struct defence
{
static int a;
}d={5};
int main()
{
struct defence d1 = d;
printf("%d %d",d1.a++,d1.a);
return 0;
}CorrectIncorrect -
Question 2 of 15
2. Question
2) What is the output displayed by the below code?
#include<stdio.h>
int main()
{
int array[2][3]={1,2,3,4,5,6};
int (*ptr)[2][3]=&array;
printf("%d ",***ptr);
printf("%d ",***(ptr+1));
printf("%d ",**(*ptr+1));
printf("%d ",*(*(*ptr+1)+2));
return 0;
}CorrectIncorrect -
Question 3 of 15
3. Question
3) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
int x = 123;
int i =printf("k""kk");
printf("%d", i);
for(x=0;x<=i;x++)
{
printf("%x",x);
}
return 0;
}CorrectIncorrect -
Question 4 of 15
4. Question
4) What is the output displayed by below two programs?
#include<stdio.h>
int main()
{
int const s=5;
int e;
double v[s]={2.0,4.0,6.0,8.0,10};
e=1|2|3|4;
printf("%f",v[e]);
return 0;
}
#include<stdio.h>
int main()
{
int const s=5;
int e;
double v[5]={2.0,4.0,6.0,8.0,10};
e=1|2|3|4;
printf("%f",v[e]);
return 0;
}CorrectIncorrect -
Question 5 of 15
5. Question
5) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
int x=011,i;
for(i=0;i<x;i+=3)
{
printf("hello");
continue;
printf("bye");
}
return 0;
}CorrectIncorrect -
Question 6 of 15
6. Question
6) Check the below program and identify the Total?
#include<stdio.h>
int main()
{
int i,j,cv='A';
for(i=5;i>=1;i--)
{
for(j=0;j<i;j++)
{
printf("%c",(cv+j));
}
printf("\n");
}
return 0;
}
Total = number of times B displayed in above code + Number of times C displayed in above code
What is Total value?CorrectIncorrect -
Question 7 of 15
7. Question
7) What is the output displayed by the below program?
Assume int is of size 4 bytes
#include<stdio.h>
int main()
{
int a,b;
char *p=(char *)0;
int *q =(int *)0;
a = (int)(p+1);
b = (int)(q+1);
printf("%d%d",a,b);
return 0;
}CorrectIncorrect -
Question 8 of 15
8. Question
8) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
int m=1;
switch(m<<2+m)
{
default: printf("default");
case 4: printf("4");
case 5: printf("5");
case 8: printf("8");
}
return 0;
}CorrectIncorrect -
Question 9 of 15
9. Question
9) What is the output displayed by the below code?
#include<stdio.h>
int main()
{
unsigned char v=0;
for(v=0;v<=255;v++)
printf("%d",v);
return 0;
}CorrectIncorrect -
Question 10 of 15
10. Question
10) What is the output displayed by the below program?
#include<stdio.h>
int x;
int main()
{
do
{
do
{
printf("%o",x);
}while(!-2);
}while(0);
return 0;
}CorrectIncorrect -
Question 11 of 15
11. Question
11) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
static int a[]={0,1,2,3,4};
int *p[]={a,a+1,a+2,a+3,a+4};
int **ptr=p;
++*ptr;
printf("%d %d %d",ptr-p,*ptr-a,**ptr);
return 0;
}CorrectIncorrect -
Question 12 of 15
12. Question
12) What is the output displayed by the below program?
#include<stdio.h>
#define v 3
int main()
{
char *c[v+~0]={"hollo","mike"};
char *ptr=c[1+~0];
printf("%c",*++ptr);
return 0;
}CorrectIncorrect -
Question 13 of 15
13. Question
13) What is the output displayed by the below code?
#include<stdio.h>
struct st
{
int r;
int c;
int s[8];
};
int main()
{
struct st s ={1,2,3,4,5,6};
int *p;
p=(int *)&s;
printf("%d",*(p+3));
return 0;
}CorrectIncorrect -
Question 14 of 15
14. Question
14) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
int i,j;
i=j=2,3;
while(--i&&j++)
printf("%d %d",i,j);
return 0;
}CorrectIncorrect -
Question 15 of 15
15. Question
15)
The below code will display the pattern
1
12
123
1234
.....
Minimum number of modifications needed to be done
adding a line or modifying a line is counted as 1 modification
#include<stdio.h>
void patternprint(int n)
{
int p=1,i,j;
for(int i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
printf("%d",p++);
}
printf("\n");
}
}
int main()
{
patternprint(5);
return 0;
}CorrectIncorrect