Font size
WorksheetsBasic C
Total questions: 39
Worksheet time: 16mins
Who invented C programming language ?
Ken Thompson
James Gosling
Dennis Ritchie
James Thompson
In C, program execution always starts from ________
int a = 30
#include<stdio.h>
main()
#include<conio.h>
Which of the following are Relational Operators in C?
=
>=
!=
||
In C, what is the correct hierarchy of arithmetic operations?
*/ + -
* +- /
/ *+ -
+ - / *
Which one of the following is correct variable declaration?
coding13
13coding
_CoDiNg_ChAlLeNgE
coding.challenge
Which loop can be used in C language so that the loop gets executed atleast once?
while
for
switch
do while
int a = 1;
int b = 18;
a++;
b--;
what is the value of a and b?
a=2
b=19
a=2
b=17
a=1
b=17
a=1
b=19
How many times the loop will get executed?
for(int i=5;i<=10;i++)
5
6
4
0
which is the correct format specifier for int ?
%c
%i
%d
%int
int a=20;
a%=20;
what is the value of a?
20
1
0
None of the above
A default statement is optional in SWITCH CASE.
true or false?
TRUE
FALSE
Which is the right order
int > char > float
char < int < double
char > int > float
double < char < int
When was the C Language developed?
1970
1972
1975
1976
C program should be written in
Upper case
Title case
lower case
none of these
Every statement in a C program should end with a -------------
Colon(:)
semicolon(;)
comma(,)
fullstop(.)
What is the result of 6%4 ?
4
3
2
1
The symbol of a new line character is -----------------------
\n
\t
\d
\f
Commonly used input function is --------------
scanf()
printf()
getch()
putch()
Commonly used output function is ------------
printf()
scanf()
getch()
none of these
%f specifies ---------------- data type
float
int
char
string
No --------------- is allowed in variable
+ sign
- sign
0
Blank space
Which of the following is not a valid C variable name?
int number;
float rate;
int variable_count;
int $main;
All keywords in C are in ____________
LowerCase letters
UpperCase letters
CamelCase letters
None of the mentioned
Which of the following is true for variable names in C?
They can contain alphanumeric characters as well as special characters
It is not an error to declare a variable to be one of the keywords(like goto, static)
Variable names cannot start with a digit
Variable can be of any length
Which of the following is not a logical operator?
&&
!
||
|
How many keywords are there in C language?
30
31
32
33
6. Which of the following cannot be a variable name in C?
volatile
true
friend
export
Which keyword is used to prevent any changes in the variable within a C program?
immutable
mutable
const
volatile
What is the result of logical or relational expression in C?
True or False
0 or 1
0 if an expression is false and any positive number if an expression is true
None of the mentioned
What is #include <stdio.h>?
Preprocessor directive
Inclusion directive
File inclusion directive
None of the mentioned
Which of the following are C preprocessors?
#ifdef
#define
#endif
all of the mentioned
The C-preprocessors are specified with _________ symbol.
#
&
%
*
scanf() is a predefined function in______header file.
stdlib. h
ctype. h
stdio. h
stdarg. h
What will be the output of the following C code?
Compile time error
Hello World! 34
Hello World! 1000
Hello World! followed by a junk value
Which is valid C expression?
int my_num = 100,000;
int my_num = 100000;
int my num = 1000;
int $my_num = 10000;
What will be the final value of x in the following C code?
3.75
Depends on compiler
24
3
