Total 15 Questions. Each Question Carry 2 Marks.
Total Time 30 Minutes.
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
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 24 marks. Please watch the c language practice examples and take the test after a weak.
- 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
Q1) What is the output displayed by the below program?
#include<stdio.h>
int c(int a)
{
if(a==0)
return 0;
else
return(a%10+2*c(a/10));
}
int main()
{
int ans;
ans=c(100);
printf("%d",ans);
return 0;
}CorrectIncorrect -
-
Question 2 of 15
2. Question
Q2) What is the output displayed by the below code?
#include<stdio.h>
int f(int a[8],int i,int sum)
{
if(i<0)
printf("%d",sum);
else
{
if((a[i]%2==1))
sum+=a[i];
f(a,i-1,sum);
}
}
int main()
{
int a[8]={1,2,3,4,5,6,7,8},n=8,sum=0;
int i=n-1;
f(a,i,sum);
return 0;
}CorrectIncorrect -
-
Question 3 of 15
3. Question
Q3) The below program will display sum of 10 multiples of 10.
Identify the wrong and missing statement?
#include<stdio.h>
int main()
{
int i=0;// statement 1
int sum=0;// Statement 2
while(i<=1000)// Statement 3
{
sum=sum+i;//Statement 4
--Missing Sataement--
}
printf("%d",sum);
return 0;
}CorrectIncorrect -
Question 4 of 15
4. Question
Q4) What is the output displayed by the below program?
#include<stdio.h>
int f(int *a,int *b)
{
int s;
s=*a+*b;
*b=*a;
return *a=s-*b;
}
int main()
{
int i=0,j=1,k=2,l;
l=i++ || f(&j,&k);
printf("%d%d%d%d",i,j,k,l);
return 0;
}CorrectIncorrect -
Question 5 of 15
5. Question
Q5) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
int x=1,i,y=2;
for(i=0;i<4;i++)
{
x<<1;
y=x+i;
}
printf(“%d%d”,x,y);
return 0;
}CorrectIncorrect -
Question 6 of 15
6. Question
Q6) Which of the following are equal to the statement?
int k = (i<<3)+(j>>2)
CorrectIncorrect -
Question 7 of 15
7. Question
Q7) What is the output displayed by the below code?
#include<stdio.h>
void f1(int *p,int *q)
{
p=q;
*p=2;
}
int i=0,j=1;
int main()
{
f1(&i,&j);
printf("%d %d",i,j);
return 0;
}CorrectIncorrect -
Question 8 of 15
8. Question
Q8) What will be the output displayed by the below code?
#include<stdio.h>
int a[5][5]={1,2,3,4,5};
int main()
{
int temp;
int c=100,i,j;
for(i=0;i<5;i++)
for(j=0;j<5;j++)
{
temp=a[i][j]+c;
a[i][j]=a[j][i];
a[j][i]=temp-c;
}
for(i=0;i<5;i++)
{
for(j=0;j<5;j++)
{
printf("%d",a[i][j]);
}
printf("\n");
}
return 0;
}CorrectIncorrect -
Question 9 of 15
9. Question
Q9) What is the output displayed by the below code?
#include<stdio.h>
#define print(x) printf("%d",x)
int x;
void q(int z)
{
z+=x;
print(z);
}
void p(int *y)
{
int x=*y+2;
q(x);
*y=x-1;
print(x);
}
int main()
{
x=5;
p(&x);
print(x);
return 0;
}CorrectIncorrect -
Question 10 of 15
10. Question
Q10) What is the output displayed by the below code?
#include<stdio.h>
#include<string.h>
int main()
{
int i;
char p[20];
char *s="string";
int length=strlen(s);
for(i=0;i<length;i++)
p[i]=s[length-i];
printf("%s",p);
return 0;
}CorrectIncorrect -
Question 11 of 15
11. Question
Q11) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
signed int a;
unsigned int b;
a=6u+ -16 +16u -6;
b=a+1;
if(a==b)
printf("%d%d",a,b);
else
printf("%u%u",a,b);
return 0;
}CorrectIncorrect -
Question 12 of 15
12. Question
Q12) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
int a[][3]={1,2,3,4,5};
int (*ptr)[5]=a;
printf("%d%d",(*ptr)[0],(*ptr)[1]);
return 0;
}CorrectIncorrect -
Question 13 of 15
13. Question
Q13) What is the output displayed by the below program?
#include<stdio.h>
void f(int **p)
{
printf(“%d”,*(*p)+1);
}
int main()
{
int a[2][3]={{3,6,9},{12,15,18}};
int *p;
p=&a;
f(&p);
return 0;
}CorrectIncorrect -
-
Question 14 of 15
14. Question
Q14) What is the output displayed by the below code?
#include<stdio.h>
#include<string.h>
int main()
{
char *p="learning";
char a[6];
strcpy(a,"monkey");
printf("%s%s",p,a);
return 0;
}CorrectIncorrect -
Question 15 of 15
15. Question
Q15) What is the output displayed by the below code?
#include<stdio.h>
int main()
{
int x=5;
int * const ptr=&x;
++(*ptr);
printf("%d",x);
return 0;
}CorrectIncorrect