Set 6
Variable And Data Types 6
Quiz-summary
0 of 10 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Information
Variables And Data Types
Questions based on:
* Data Types in C language
* Format Specifiers
* Tokens
* Identifiers
* Constants
* Keywords
* Operators
* sizeof()
* enum
* typedef
* typecasting, etc.
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 10 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Average score |
|
Your score |
|
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- Answered
- Review
-
Question 1 of 10
1. Question
1 pointsIs it possible to run C program without main() function?
Correct
Hint:
Ideally No but remember pragma directives allows few function to be executed before and after main() functionIncorrect
Hint:
Ideally No but remember pragma directives allows few function to be executed before and after main() function -
Question 2 of 10
2. Question
1 pointsHow many main() function we can have in our project?
Correct
We can’t have more than one main() function in a project.
Incorrect
We can’t have more than one main() function in a project.
-
Question 3 of 10
3. Question
1 pointsWhat is sizeof() in C?
Correct
Anything which has opening and closing braces () is not function
Incorrect
Anything which has opening and closing braces () is not function
-
Question 4 of 10
4. Question
1 pointsIs it true that a function may have several declarations, but only one definition?
Correct
Declaration like int sum(int, int); is allowed number of times but definition int sum(int a, int b) { return a+b; } is allowed only one time. Multiple definitions of the same function is compilation error ( redefinition error )
Incorrect
Declaration like int sum(int, int); is allowed number of times but definition int sum(int a, int b) { return a+b; } is allowed only one time. Multiple definitions of the same function is compilation error ( redefinition error )
-
Question 5 of 10
5. Question
1 pointsWhat will be the output?
int main()
{
extern int i;
i = 20;
printf(“%d”, sizeof(i));
return 0;
}Correct
extern int i;
tells the compiler that int i is declared in some other file, in this code we have not included any other header file so it will cause a compilation error.
Incorrect
extern int i;
tells the compiler that int i is declared in some other file, in this code we have not included any other header file so it will cause a compilation error.
-
Question 6 of 10
6. Question
1 pointsIs the following statement a declaration or definition
extern int i;Correct
Incorrect
-
Question 7 of 10
7. Question
1 pointsWhich programming language is more faster among these?
Correct
Execution flow ( faster to slower) Binary -> Assembly -> C -> C++ > Java / PHP / VB
Incorrect
Execution flow ( faster to slower) Binary -> Assembly -> C -> C++ > Java / PHP / VB
-
Question 8 of 10
8. Question
1 pointsWhich of the following is executed by Preprocess?
Correct
statements starting with # symbol are always processed by pre-processor
Incorrect
statements starting with # symbol are always processed by pre-processor
-
Question 9 of 10
9. Question
1 pointsint main()
{
int _ = 10;
int __ = 20;
int ___ = _ + __;
printf(“__%d”,___);
return 0;
}Correct
Hint:
multiple underscore ie. _ can be used to create variables.Incorrect
Hint:
multiple underscore ie. _ can be used to create variables. -
Question 10 of 10
10. Question
1 pointsWhat is the output of the following program?
int main()
{
int a = 5;
int b = 10;
int c = a+b;
printf(“%i”,c);
}Correct
Hint:
%i is also used to printf numeric values in C. %d and %i both solve the same purpose.Incorrect
Hint:
%i is also used to printf numeric values in C. %d and %i both solve the same purpose.