0% found this document useful (0 votes)
42 views2 pages

C Programming Day 1 Test Duration: 20 Min

This document contains a 15 question C programming language quiz covering topics like data types, operators, loops, and conditional statements. The questions test knowledge of basic C syntax and semantics, like determining the output of code snippets, the developers who created C, variable declaration formats, and loop and conditional behavior. Correct answers are provided for self-assessment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views2 pages

C Programming Day 1 Test Duration: 20 Min

This document contains a 15 question C programming language quiz covering topics like data types, operators, loops, and conditional statements. The questions test knowledge of basic C syntax and semantics, like determining the output of code snippets, the developers who created C, variable declaration formats, and loop and conditional behavior. Correct answers are provided for self-assessment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

C Programming

Day 1 Test

Duration

1. What will be the output of the following program?


int main()
{
printf("%f",123.);
return(0);
}
A. 123
B. Compile-Time Error
C. 123.00
D. 123.000000
2. C language was developed by?
A. Dennis Ritchie
B. Martin Richards
C. Bill Gates
D. Ken Thompson
3. What will be the output of the following program :
int main()
{
printf("%d",sizeof(integer));
return(0);
}
A. 2
B. Compile-Time Error
C.4
D. None of these
4. What will be the output of the following program :
int main()
{
printf("%d",!(100==100)+1);
return(0);
}
A. 100
B. 0
C. 1
D.2
5. What will be the output of the following program :
int main()
{
printf("%d %d %d",5,!5,25-!25);
return(0);
}
A. 5 10 22
B. 5 5 25
C.5 0 25
D.5 1 24
6. A character variable can store x characters at a time:
A.1 character
B.8 character
C.256 character
D.None of the above
7. What is the output of the following program?
int main(){
int c=08;
printf("%d",c);
return 0;
}
A.8
B.0
C. Compile Time Error
D.None of the Above

: 20 Min

C Programming
Day 1 Test

Duration

8. The format identifier %i is also used for _____ data type?


A. char
B. int
C. float
D. double
9. What is the size of an int data type?
A. 4 Bytes
B.8 Bytes
C. Depends on the system/compiler
D. Cannot be determined
10. What is the output of this C code?
main()
{
Char c;
c=128;
printf(%d\n,c);
}
A.128
B. -128
C. Depends on the compiler
D. None of the mentioned
11. What is the output of this C code?
main()
{
j = 10;
printf("%d\n", j++);
}
A.10
B.11
C. Compile time error
D.0
12. Which of the following declaration is not supported by C?
A. String str;
B. char *str;
C.float str = 3e2;
D. Both (a) and (c)
13. The following code for(;;) represents an infinite loop. It can be terminated by.
A. break
B. exit(0)
C. abort()
D. All of the mentioned
14. Which keyword is used to prevent any changes in the variable within a C program?
A. immutable
B. mutable
C. const
D. volatile
15. What is the output of this C code?
int main()
{
int x = 1;
if (x > 0)
printf("inside if\n");
else if (x > 0)
printf("inside elseif\n");
}
A. inside if
B. inside elseif
C. inside if inside elseif
D. Compile time error

: 20 Min

You might also like