WorksheetsC-Programming
Total questions: 15
Worksheet time: 8mins
Which of the following is a invalid variable name
BASICSALARY
BasicSalary
1_basicsalary
_basicsalary
Point out the erroneous statements
a+c = d
a= 2+3
a = 'c'+'d'
a = b
The maximum value that an integer constant can have is
32767
-32767
1.7014e+38
–1.7014e+38
A character variable can never store more than
32 characters
18 characters
2 characters
1 character
Which of the following is FALSE in C
Keywords can be used as variable names
Variable names can contain a digit
Variable names do not contain a blank space
Capital letters can be used in variable names
In C, Arithmetic instruction cannot contain
variables
constants
variable names on right side of =
constants on left side of =
C language has been developed by
Ken Thompson
Dennis Ritchie
Peter Norton
Martin Richards
C programs are converted into machine language with the help of
An Editor
an IDE
An operating system
Compiler
What of the following is not a correct way of defining a constant
#define num 25
const int A=10;
#define num =25
const float A=10
Which of the following is not a correct for identifier
it is a name given to various elements of the program
an identifier can be in uppercase or lowercase
it can use a special symbol _ (underscore)
start of an identifier should always be with a digit
scanf() function is an example of
formatted output function
keyword
variable
formatted input function
Which of the following is not true for #include<stdio.h> header file
It is called a preprocessor directive
It is used to direct the processor to include the header file in the program
it is used to perform calculations in a program
it is a standard input output header file
select the correct syntax to read a variable named num of type integer from user
scanf("%d",num);
scanf("%d",&num);
scanf("%d,&num");
scanf("%d,num");
To display the value of a variable num of type integer, select the correct statement
printf("The number is num");
printf("The number is %d",&num);
printf("The number is num,%d");
printf("The number is %d",num);
How many bytes are reserved in memory for integer variables in c-program(for 16-bit compiler)
2
4
8
1
