C Programming 5
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 : B
Explanation : No answer description
IncorrectAnswer : B
Explanation : No answer description
-
Question 2 of 20
2. Question
1 pointsCorrectAnswer : C
Explanation : gets(); reads a group of characters terminated by a new line from the standard input stream stdin.
IncorrectAnswer : C
Explanation : gets(); reads a group of characters terminated by a new line from the standard input stream stdin.
-
Question 3 of 20
3. Question
1 pointsCorrectAnswer : C
Explanation : char *strrchr(const char *s, int c);
It scans a string s in the reverse direction, looking for a specific character c.
IncorrectAnswer : C
Explanation : char *strrchr(const char *s, int c);
It scans a string s in the reverse direction, looking for a specific character c.
-
Question 4 of 20
4. Question
1 pointsCorrectAnswer : C
Explanation : The strcmp return an int value that is if s1 < s2 returns a value < 0 & if s1 == s2 returns 0 & if s1 > s2 returns a value > 0
IncorrectAnswer : C
Explanation : The strcmp return an int value that is if s1 < s2 returns a value < 0 & if s1 == s2 returns 0 & if s1 > s2 returns a value > 0
-
Question 5 of 20
5. Question
1 pointsCorrectAnswer : A
Explanation : No answer description.
IncorrectAnswer : A
Explanation : No answer description .
-
Question 6 of 20
6. Question
1 points.
In the following code, the P2 is Integer Pointer or Integer?
typedef int *ptr;
ptr p1, p2;
CorrectAnswer : B
Explanation : No answer description.
IncorrectAnswer : B
Explanation : No answer description.
-
Question 7 of 20
7. Question
1 points.
In which stage the following code
#include<stdio.h>
gets replaced by the contents of the file stdio.h
CorrectAnswer : D
Explanation : The preprocessor replaces the line #include <stdio.h> with the system header file of that name. More precisely, the entire text of the file ‘stdio.h’ replaces the #include directive.
IncorrectAnswer : D
Explanation : The preprocessor replaces the line #include <stdio.h> with the system header file of that name. More precisely, the entire text of the file ‘stdio.h’ replaces the #include directive.
-
Question 8 of 20
8. Question
1 points.
What will the SWAP macro in the following program be expanded to on preprocessing? will the code compile?
#include<stdio.h>
#define SWAP(a, b, c)(c t; t=a, a=b, b=t)
int main()
{
int x=10, y=20;
SWAP(x, y, int);
printf(“%d %d\n”, x, y);
return 0;
}
CorrectAnswer : C
Explanation : The code won’t compile since declaration of t cannot occur within parenthesis.
IncorrectAnswer : C
Explanation : The code won’t compile since declaration of t cannot occur within parenthesis.
-
Question 9 of 20
9. Question
1 pointsCorrectAnswer : B
Explanation : No answer description .
IncorrectAnswer : B
Explanation : No answer description
-
Question 10 of 20
10. Question
1 points.
If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?
CorrectAnswer : D
Explanation : No answer description.
IncorrectAnswer : D
Explanation : No answer description.
-
Question 11 of 20
11. Question
1 pointsCorrectAnswer : C
Explanation : The macro “NULL” is defined in locale.h, stddef.h, stdio.h, stdlib.h, string.h, time.h, and wchar.h.
IncorrectAnswer : C
Explanation : The macro “NULL” is defined in locale.h, stddef.h, stdio.h, stdlib.h, string.h, time.h, and wchar.h.
-
Question 12 of 20
12. Question
1 points.
Which keyword is used to transfer control from a function back to the calling function ?
CorrectAnswer : D
Explanation : The return is used to transfer control from a function back to the calling function.
IncorrectAnswer : D
Explanation : The return is used to transfer control from a function back to the calling function.
-
Question 13 of 20
13. Question
1 points.
What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?
CorrectAnswer : C
Explanation : If the index of the array size is exceeded, the program will crash. Hence “option c” is the correct answer.
IncorrectAnswer : C
Explanation : If the index of the array size is exceeded, the program will crash. Hence “option c” is the correct answer.
-
Question 14 of 20
14. Question
1 pointsCorrectAnswer : C
Explanation : When we pass an array as a function argument, the base address of the array will be passed.
IncorrectAnswer : C
Explanation : When we pass an array as a function argument, the base address of the array will be passed.
-
Question 15 of 20
15. Question
1 pointsCorrectAnswer : C
Explanation : No answer description.
IncorrectAnswer : C
Explanation : No answer description.
-
Question 16 of 20
16. Question
1 points.
What is the output of this C code?
#include <stdio.h>
void main()
{
int i = 2;
do
{
printf(“Hi”);
} while (i < 2)
}
CorrectAnswer : A
Explanation : No answer description.
IncorrectAnswer : A
Explanation : No answer description.
-
Question 17 of 20
17. Question
1 points.
What is the output of this C code?
#include <stdio.h>
int main()
{
int i = 0, j = 0;
while (i < 5, j < 10)
{
i++;
j++;
}
printf(“%d, %d\n”, i, j);
}
CorrectAnswer : C
Explanation : No answer description.
IncorrectAnswer : C
Explanation : No answer description.
-
Question 18 of 20
18. Question
1 points.
What is the output of this C code?
#include <stdio.h>
int main()
{
int i = 0;
do {
i++;
printf(“In while loop\n”);
} while (i < 3);
}
CorrectAnswer : A
Explanation : No answer description.
IncorrectAnswer : A
Explanation : No answer description.
-
Question 19 of 20
19. Question
1 points.
What is the output of this C code?
#include <stdio.h>
int main()
{
for (int i = 0;i < 1; i++)
printf(“In for loop\n”);
}
CorrectAnswer : C
Explanation : No answer description.
IncorrectAnswer : C
Explanation : No answer Description.
-
Question 20 of 20
20. Question
1 points.
What would be the size of the following union declaration?
#include <stdio.h>
union uTemp
{
double a;
int b[10];
char c;
}u;
(Assuming size of double = 8, size of int = 4, size of char = 1)
CorrectAnswer : C
Explanation : No answer description.
IncorrectAnswer : C
Explanation : No answer Description.