TCLI
All Tests
C Programming Basics
1. Which symbol is used to end a statement in C?
:
;
.
2. What is the correct syntax to print in C?
print("Hello")
printf("Hello");
echo("Hello");
3. Which data type is used for decimal values?
int
float
char
4. What is the size of int in C (typically)?
2 bytes
4 bytes
8 bytes
5. Which header file is needed for printf()?
math.h
stdio.h
string.h
6. What does '&' operator do in scanf()?
Logical AND
Address of operator
Bitwise AND
7. Which loop executes at least once?
for loop
while loop
do-while loop
8. What is the correct way to declare a pointer?
int ptr;
int *ptr;
int &ptr;
9. Which function is used to allocate memory dynamically?
alloc()
malloc()
calloc()
10. What does '\n' represent in C?
New line
Null character
Tab space
> Submit Test
_