NEW
Font size
WorksheetsModule 1_Introduction to C Programming
Total questions: 10
Worksheet time: 5mins
Which of the following is not a valid C variable name?
int number
float rate
int variable_count
int $main
What is #include <stdio.h>?
Preprocessor directive
Inclusion directive
File inclusion directive
None of the mentioned
What is the sizeof(char) in a 32-bit C compiler?
1 bit
2 bits
1 Byte
2 Bytes
scanf() is a predefined function in______header file.
stdlib. h
ctype. h
stdio. h
stdarg. h
#include <stdio.h>
int main()
{
int y = 10000;
int y = 34;
printf("Hello World! %d\n", y);
return 0;
}
Compile time error
Hello World! 34
Hello World! 1000
Hello World! followed by a junk value
#include <stdio.h>
void main()
{
int x = 5 * 9 / 3 + 9;
}
3.75
Depends on compiler
24
3
How many keywords are there in C Language ?
30
22
32
36
What is the output of this program?
#include <stdio.h>
int main()
{
int x = 10;
float x = 10.0;
printf("%d",x);
return 0;
}
10.1
Compilations Error
10
10
Which of the following is true for variable names in C?
Variable names cannot start with a digit
Variable can be of any length
They can contain alphanumeric characters as well as special characters
Reserved Word can be used as variable name
What is the output of this C code?
#include <stdio.h>
int main()
{
float x = ‘a’;
printf(“%f”, x);
return 0;
}
97.000000
run time error
a.0000000
a
