WorksheetsC-Basic
Total questions: 10
Worksheet time: 4mins
C programs are converted into machine language with the help of
IDE
VScode
An operating system
A compiler
What will be the output of the following C code?
Run time error
h e
h h
h l
1
2
Compile error
Runtime error
Which keyword is used to come out of a loop only for that iteration?
break
return
continue
exit
How would you round off a value from 1.66 to 2.0?
ceil(1.66)
roundup(1.66)
floor(1.66)
roundto(1.66)
A Variable name in C includes which special symbols?
* (asterisk)
# (Hash)
+ (Addition)
_ (underscore)
Which header file supports the functions - malloc() and calloc()?
stdlib.h
memory.h
math.h
stdio.h
Which of the following is the correct usage of conditional operators used in C?
return (a>b)?(a:b)
a>b ? c=30;
max = a>b ? a>c?a:c:b>c?b:c
a>b ? c=30 : c=40;
What will be the output of the program?
int x=4, y, z;
y = --x;
z = x--;
printf("%d, %d, %d\n", x, y, z);
3,3,2
4,3,3
4,3,2
2,3,3
Which of the following are unary operators in C?
1. !
2. sizeof
3. ~
4. &&
1,2
2,4
1,3
1,2,3
