Variable And Data Types 5
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 pointsWhat will be the output of the following C function?
#include
enum birds {SPARROW, PEACOCK, PARROT};
enum animals {TIGER = 8, LION, RABBIT};
int main()
{
enum birds m = TIGER;
int k;
k = m;
printf(“%d\n”, k);
return 0;
}Correct
Explanation:
Enumerators are integer constants. so m is an integer constant, hence it is compatible.
8Incorrect
Explanation:
Enumerators are integer constants. so m is an integer constant, hence it is compatible.
8 -
Question 2 of 10
2. Question
1 pointsWhich of the data types has the size that is variable?
Correct
Explanation:
Since the size of the structure depends on its fields, it has a variable size.
Incorrect
Explanation:
Since the size of the structure depends on its fields, it has a variable size.
-
Question 3 of 10
3. Question
1 pointsWhat will be the output of the following C code?
#include <stdio.h>
#define MAX 2
enum bird {SPARROW = MAX + 1, PARROT =SPARROW + MAX};
int main()
{
enum bird b = PARROT;
printf(“%d\n”, b);
return 0;
}
Correct
Explanation:
MAX value is 2 and hence PARROT will have value 3 + 2.
So Answer will be 5Incorrect
Explanation:
MAX value is 2 and hence PARROT will have value 3 + 2.
So Answer will be 5 -
Question 4 of 10
4. Question
1 pointsWhat will be the output of the following C code?
#include<stdio.h>
int main()
{
printf(“hello %s\n”,”Catalyst”);
}
Correct
Incorrect
-
Question 5 of 10
5. Question
1 pointsenum types are processed by _________
Correct
Incorrect
-
Question 6 of 10
6. Question
1 pointsWhat will be the output of the following C code?
#include <stdio.h>
int main()
{
int var = 010;
printf(“%d”, var);
}
Correct
Explanation:
010 is octal representation of 8.
So answer is : 8Incorrect
Explanation:
010 is octal representation of 8.
So answer is : 8 -
Question 7 of 10
7. Question
1 pointsWhat will be the output of the following C code?
#include<stdio.h>
int main()
{
printf(“Hello %s\n”,”Catalyst %s”,”Tech”);
}
Correct
Incorrect
-
Question 8 of 10
8. Question
1 pointsWhat will be the output of the following C code?
#include<stdio.h>
int main()
{
printf(“Hello %s %s\n”,”Catalyst”,”Tech”);
}
Correct
Incorrect
-
Question 9 of 10
9. Question
1 pointsWhat will be the output of the following C code?
#include <stdio.h>
int main()
{
printf(“Hello\rComputer”);
return 0;
}
Correct
Incorrect
-
Question 10 of 10
10. Question
1 pointsWhat will be the output of the following C code?
#include <stdio.h>
int main()
{
printf(“Computer\rHello”);
return 0;
}
Correct
Incorrect