C Programming: Declarations and Initializations – Point Out Correct Statements
- Declarations and Initializations – General Questions
- Declarations and Initializations – Find Output of Program
- Declarations and Initializations – Point Out Errors
- Declarations and Initializations – Point Out Correct Statements
- Declarations and Initializations – True / False Questions
- Declarations and Initializations – Yes / No Questions
1. Which of the declaration is correct?
A. int length;
B. char int;
C. int long;
D. float double;
2. Which of the following operations are INCORRECT?
A. int i = 35; i = i%5;
B. short int j = 255; j = j;
C. long int k = 365L; k = k;
D. float a = 3.14; a = a%3;
3. Which of the following correctly represents a long double constant?
A. 6.68
B. 6.68L
C. 6.68f
D. 6.68LF
4. Which of the structure is incorrcet?
1 : struct aa
{
int a;
float b;
};
2 : struct aa
{
int a;
float b;
struct aa var;
};
3 : struct aa
{
int a;
float b;
struct aa *var;
};
A. 1
B. 2
C. 3
D. 1, 2, 3
5. Which of the structure is correct?
1 : struct book
{
char name[10];
float price;
int pages;
};
2 : struct aa
{
char name[10];
float price;
int pages;
}
3 : struct aa
{
char name[10];
float price;
int pages;
}
A. 1
B. 2
C. 3
D. All of above