C Programming
Quiz-summary
0 of 12 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
Information
- You will be given 180 seconds ( 3 minutes) for every question.
- Every question may contain multiple answers.Once you click the submit button you can not change your answer. You cannot go back to the same question once you click the submit button.
- Every question carries the marks equal to its difficulty level ( from 1 to 5).
- There is a negative marking of -1 for every wrong answer.
- Once a set of questions is complete, you can wait for another set of questions or you can try some other category.
- Your total marks will be displayed after every question.
- For any doubts/comments/suggestions on the question you can go to same question in untimed section.
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 have to finish following quiz, to start this quiz:
Results
0 of 12 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Categories
- C Programming 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- Answered
- Review
-
Question 1 of 12
1. Question
5 pointsWhat will be the output of the following C program
main()
{
int count, i, x;
for(count=1,x=0,i=0; count<=4;count++,i++)
{
x=i%2;
if(x==0)
continue;
else
{
printf(“%d\n”,x);
continue;
}
}
printf(“%d”,count);
}Correct
Incorrect
-
Question 2 of 12
2. Question
5 pointsFor calculating the sum of 100 numbers stored in the array we have following code
for (int x = 0; x < 100; x++)
{
S=S+a[x];
}
The above code can be replaced by one of the following code which will involve less operationsCorrect
Incorrect
-
Question 3 of 12
3. Question
5 pointsWhat will be the output of the following program
main()
{
int i,j,k,x=0;
for(i=0;i<5;++i)
for(j=0;j<i;++j)
{
k = (i+j-1);
if(k%2==0)
x+=k;
else
if(k%3==0)
x+=k-2;
}
printf(“\n%d”,x);
}Correct
Incorrect
-
Question 4 of 12
4. Question
5 pointsWhat will be the output of the following program
main()
{
int k = 3;
switch(k)
{
default : k += 2;
case 4 : k +=1;
case 5: –k;
}
printf(“%d”,k);Correct
Incorrect
-
Question 5 of 12
5. Question
5 pointsWhat will be the output of the following program
main()
{
int y, x = 1, total = 0;
while ( x <= 10 )
{
y = x * x;
total += y;
++x;
} // end while
printf(“%d”, total);
}Correct
Incorrect
-
Question 6 of 12
6. Question
5 pointsWhat will be the output of the following program
main()
{
int i=0,x=0;
for(i=1;i<10;++i)
{
if(i%2 == 1)
x += i;
else
x–;
printf(“\n%d”,x);
break;
}
printf(“\nx=%d”,x); }Correct
Incorrect
-
Question 7 of 12
7. Question
5 pointsWhat will be the output of the following program
void main()
{
float r[2]={1.2,2.3};
*( r + 1) = 222.2;
*r = * (r + 1);
printf(“%f”,r[0]);
}Correct
Incorrect
-
Question 8 of 12
8. Question
5 pointsWhat will be the output of the following program
main()
{
char *s1 = “ABCDE”;
char *s2 = “AB”;
while(*s1 == *s2)
{
if (* s1 ==’\0′ || *s2 == ‘\0’)
break;
s1++ ;
s2++; }
if(*s2 == ‘\0’)
printf(“ABC”) ;
else
printf(“XYZ”);
}Correct
Incorrect
-
Question 9 of 12
9. Question
5 pointsWhat will be the output of the following program
main()
{
int i , a[] = {34, 56, 78, 89, 90};
for ( i=0; i <=4 ; i++)
{
if (i)
continue ;
else
printf(“%d”, a[i]);
}
}Correct
Incorrect
-
Question 10 of 12
10. Question
5 points#define SQUARE(n) n*n
main()
{
int j;
j=16/SQUARE(2);
printf(“j=%d”,j);
}Correct
Incorrect
-
Question 11 of 12
11. Question
5 pointsWhich statement is true for the following
switch(I)
{
case -1: n++;
case 0: z++;
break;
case 1: p++;
break;
}Correct
Incorrect
-
Question 12 of 12
12. Question
5 pointsHow many iterations will be there for the following while loop
I=0;
Num=10;
while(I<num)
{
I=I+2;
I=I-1;
}Correct
Incorrect