C Programming 3
Questions Result & StatisticsQuiz-summary
0 of 20 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
Information
Questions
Instruction:
- Total number of questions : 20
- Time allotted : 25 minutes.
- Each question carry 1 mark, no negative marks.
- Click the “Finish quiz” button given in bottom of this page to submit your answer.
- Test will be submitted automatically if the time expired.
- Don’t refresh the page.
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
Marks : 0 of 20 questions answered correctly | ||
Total number of questions | : | 20 |
Number of currect answered | : | 0 |
Your time | : |
|
Time has elapsed
You have reached 0 of 0 points, (0)
Categories
- Not categorized 0%
-
Thank you for submitting online test!
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- Answered
- Review
-
Question 1 of 20
1. Question
1 pointsCorrectAnswer : A
No Explanation
IncorrectAnswer : A
No Explanation
-
Question 2 of 20
2. Question
1 pointsCorrectAnswer : A
No Explanation
IncorrectAnswer : A
No Explanation
-
Question 3 of 20
3. Question
1 pointsCorrectAnswer : B
No Explanation
IncorrectAnswer : B
No Explanation
-
Question 4 of 20
4. Question
1 pointsCorrectAnswer : D
No Explanation
IncorrectAnswer : D
No Explanation
-
Question 5 of 20
5. Question
1 pointsCorrectAnswer : C
No Explanation
IncorrectAnswer : C
No Explanation
-
Question 6 of 20
6. Question
1 pointsCorrectAnswer : B
No Explanation
IncorrectAnswer : B
No Explanation
-
Question 7 of 20
7. Question
1 pointsCorrectAnswer : A
No Explation
IncorrectAnswer : A
No Explation
-
Question 8 of 20
8. Question
1 pointsCorrectAnswer : A
No Explanation
IncorrectAnswer : A
No Explanation
-
Question 9 of 20
9. Question
1 pointsCorrectAnswer : C
No Explanation
IncorrectAnswer : C
No Explanation
-
Question 10 of 20
10. Question
1 pointsCorrectAnswer : B
No Explanation
IncorrectAnswer : B
No Explanation
-
Question 11 of 20
11. Question
1 points.
What is the output of the following program code?
main ()
{
int i, j, k;
i = 3;
j =2*(i++);
k =2*(++i);
}
CorrectAnswer : B
Explanation : In the expression j = 2 * (i++) the value of i is used before incrementing and
k =2*(++i); will get incremented first and then used in the expression
IncorrectAnswer : B
Explanation : In the expression j = 2 * (i++) the value of i is used before incrementing and
k =2*(++i); will get incremented first and then used in the expression
-
Question 12 of 20
12. Question
1 points.
How many times the below program code will run
main()
{
int i;
i = 0;
do
{
–i;
printf (“%d”,i);
i++;
} while (i >= 0)
}
CorrectAnswer : B
Explanation : In every iteration value of i is decremented and
then incremented so remains 0 and hence the output is Infinite Loop.
IncorrectAnswer : B
Explanation : In every iteration value of i is decremented and
then incremented so remains 0 and hence the output is Infinite Loop.
-
Question 13 of 20
13. Question
1 points.
What would be the output if option = ‘H’?
switch (option)
{
case ‘H’ : printf(“Hello”);
case ‘W’ : printf(“Welcome”);
case ‘B’ : printf (“Bye”);
break;
}
CorrectAnswer : C
Explanation : there is no break statement after the case to come out so the program execute all case statements
IncorrectAnswer : C
Explanation : there is no break statement after the case to come out so the program execute all case statements
-
Question 14 of 20
14. Question
1 points.
What will be the output of the following program?
main()
{
printf (“%c”,”Gyantonic”[4]);
}
CorrectAnswer: C
Explanation: Gyantonic is a constant string and character at index 4 will get printed.
IncorrectAnswer: C
Explanation: Gyantonic is a constant string and character at index 4 will get printed.
-
Question 15 of 20
15. Question
1 pointsCorrectAnswer : B
Explanation: a==b is a expression and will return 1 (true) or 0 (False) depending on the values of a and b. Here a and b are not equal so 0 is printed.
IncorrectAnswer : B
Explanation: a==b is a expression and will return 1 (true) or 0 (False) depending on the values of a and b. Here a and b are not equal so 0 is printed.
-
Question 16 of 20
16. Question
1 pointsCorrectAnswer: A
Explanation : Values in the function get passed from right to left. First !a++ get processed which pass zero as argument and make a equal to 11.
IncorrectAnswer: A
Explanation : Values in the function get passed from right to left. First !a++ get processed which pass zero as argument and make a equal to 11.
-
Question 17 of 20
17. Question
1 points.
What will be the output of below program?
main()
int i;
i =10;
if (i ==20 || 30)
{
printf(“True”);
}
else
{
printf(“False”);
}
}
CorrectAnswer : A
Explanation : i==20 is a expression returns TRUE or FALSE depending on the value of i.
In this program it will return 0 so the statement becomes If ( 0 || 30) when 30 OR ed with 0 will result TRUE.
IncorrectAnswer : A
Explanation : i==20 is a expression returns TRUE or FALSE depending on the value of i.
In this program it will return 0 so the statement becomes If ( 0 || 30) when 30 OR ed with 0 will result TRUE.
-
Question 18 of 20
18. Question
1 points.
What will be the output of following code?
main()
{
if (1,0)
{
printf(“True”);
}
else
{
printf(“False”);
}
}
CorrectAnswer : B
Explanation : comma(,) operator returns the value which at the right hand side of , if statement become if(0)
IncorrectAnswer : B
Explanation : comma(,) operator returns the value which at the right hand side of (,) if statement become if(0)
-
Question 19 of 20
19. Question
1 points.
How many times main() will get called?
main( )
{
printf ( “\nMain called again” ) ;
main( ) ;
}
CorrectAnswer : D
Explanation : There is no condition in the main() to stop the recursive calling of the main() hence it will be called infinite no of times.
IncorrectAnswer : D
Explanation : There is no condition in the main() to stop the recursive calling of the main() hence it will be called infinite no of times.
-
Question 20 of 20
20. Question
1 points.
What will be the output of the following program if the base address of array is 100.
main( )
{
int gyan[] = { 1, 2, 3, 4, 5 };
int i, *ptr ;
ptr = gyan ;
for ( i = 0 ; i <4 ; i++ )
{
printf ( “\n%d”, *ptr++ ) ;
}
}
CorrectAnswer : A
Explanation : ptr contains the base address of the array and printf() is printing the value at the current address contained by ptr
and then incrementing the pointer to point to the next array element address.
IncorrectAnswer : A
Explanation : ptr contains the base address of the array and printf() is printing the value at the current address contained by ptr
and then incrementing the pointer to point to the next array element address.