C Programming 1
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 points.
Variable name resolving (number of significant characters for uniqueness of variable) depends on
CorrectAnswer : A
No Explanation
IncorrectAnswer : A
No Explanation
-
Question 3 of 20
3. Question
1 pointsCorrectAnswer : D
Explanation : Special character is not allowed in a variable name.
IncorrectAnswer : D
Explanation : Special character is not allowed in a variable name.
-
Question 4 of 20
4. Question
1 pointsCorrectAnswer : C
Explanation : Variable name cannot start with a digit
IncorrectAnswer : C
Explanation : Variable name cannot start with a digit
-
Question 5 of 20
5. Question
1 pointsCorrectAnswer : B
Explanation : space, comma and $ cannot be used in a variable name.
IncorrectAnswer : B
Explanation : space, comma and $ cannot be used in a variable name.
-
Question 6 of 20
6. Question
1 points.
2. What is the output of this C code?
#include <stdio.h>
int main()
{
printf(“Hello World! %d \n”, x);
return 0;
}
CorrectAnswer : C
Explanation : It results in an error since x is used without declaring the variable x.IncorrectAnswer : C
Explanation : It results in an error since x is used without declaring the variable x. -
Question 7 of 20
7. Question
1 points.
What is the output of this C code?
#include <stdio.h>
int main()
{
int y = 10000;
int y = 34;
printf(“Hello World! %d\n”, y);
return 0;
}
CorrectAnswer : A
Explanation : Since y is already defined, redefining it results in an error.
IncorrectAnswer : A
Explanation : Since y is already defined, redefining it results in an error.
-
Question 8 of 20
8. Question
1 pointsCorrectAnswer : D
Explanation : #define PI 3.14 is a macro preprocessor, it is a textual substitution.
IncorrectAnswer : D
Explanation : #define PI 3.14 is a macro preprocessor, it is a textual substitution.
-
Question 9 of 20
9. Question
1 points.
What will happen if the below program is executed?
#include <stdio.h>
int main()
{
int main = 3;
printf(“%d”, main);
return 0;
}
CorrectAnswer : C
Explanation : A C program can have same function name and same variable name.
IncorrectAnswer : C
Explanation : A C program can have same function name and same variable name.
-
Question 10 of 20
10. Question
1 pointsCorrectAnswer : A
Explanation : volatile is C keyword.
IncorrectAnswer : A
Explanation : volatile is C keyword.
-
Question 11 of 20
11. Question
1 pointsCorrectAnswer : B
No Explanation
IncorrectAnswer : B
No Explanation
-
Question 12 of 20
12. Question
1 pointsCorrectAnswer : B
Explanation : Both %d and %i can be used as a format identifier for int data type.
IncorrectAnswer : B
Explanation : Both %d and %i can be used as a format identifier for int data type.
-
Question 13 of 20
13. Question
1 pointsCorrectAnswer : A
Explanation : 65000 comes in the range of short (16-bit) which occupies the least memory.
IncorrectAnswer : A
Explanation : 65000 comes in the range of short (16-bit) which occupies the least memory.
-
Question 14 of 20
14. Question
1 pointsCorrectAnswer : D
Explanation : typedef and struct are used to define user-defined data types.
IncorrectAnswer : D
Explanation : typedef and struct are used to define user-defined data types.
-
Question 15 of 20
15. Question
1 pointsCorrectAnswer : C
Explanation : The size of the data types depend on the system.
IncorrectAnswer : C
Explanation : The size of the data types depend on the system.
-
Question 16 of 20
16. Question
1 points.
What is the output of this C code?
#include <stdio.h>
int main()
{
char chr;
chr = 128;
printf(“%d\n”, chr);
return 0;
}
CorrectAnswer : B
Explanation : signed char will be a negative number.
IncorrectAnswer : B
Explanation : signed char will be a negative number.
-
Question 17 of 20
17. Question
1 points.
Comment on the output of this C code?
#include <stdio.h>
int main()
{
float f1 = 0.1;
if (f1 == 0.1)
printf(“equal\n”);
else
printf(“not equal\n”);
}
CorrectAnswer : B
Explanation : 0.1 by default is of type double which has different representation than float.
IncorrectAnswer : B
Explanation : 0.1 by default is of type double which has different representation than float.
-
Question 18 of 20
18. Question
1 pointsCorrectAnswer : C
Explanation : char has lesser bytes than int and int has lesser bytes than double in any system.
IncorrectAnswer : C
Explanation : char has lesser bytes than int and int has lesser bytes than double in any system.
-
Question 19 of 20
19. Question
1 points.
What is the output of this C code?
#include <stdio.h>
int main()
{
float x = ‘a’;
printf(“%f”, x);
return 0;
}
CorrectAnswer : D
Explanation : Since the ASCII value of a is 97, the same is assigned to the float variable and printed.
IncorrectAnswer : D
Explanation : Since the ASCII value of a is 97, the same is assigned to the float variable and printed.
-
Question 20 of 20
20. Question
1 points.
Consider on following declaration:
(i) short i=10;
(ii) static i=10;
(iii) unsigned i=10;
(iv) const i=10;
CorrectAnswer : D
No Explanation
IncorrectAnswer : D
No Explanation