NEW
Font size
WorksheetsC Language Test
Total questions: 35
Worksheet time: 25mins
C is a ___.
Low level language
High level language
Medium level language
None of the above
How many keywords are there in C language?
32
33
64
18
C language is a ___.
Procedural oriented programming language
General purpose programming language
Structured programming
All of the above
In which version of C language, the C++ Style comment (//) are introduced?
C17
C18
C89
C99
The C source file is processed by the ___.
Interpreter
Compiler
Both Interpreter and Compiler
Assembler
Who is known as the father of C language?
James A Gosling
Dennis Ritchie
Bjarne Stroustrup
E F Codd
C language was initialized in the year?
1976
1972
1970
1974
In printf, f stands for?
Formater
format
file
file format
in C language, # refers to?
Symbol
Processor
Post processor
Pre Processor
Printf is which type of function?
Pre-defined output
user-defined output
output
pre-defined input
What is the output of this code?
char ch;
ch=A;
printf(“%c”,ch);
A
97
65
garbage value
What is the output of the following code
int a=33,b;
b=(a++)-(--a);
printf("%d",b);
33
-33
0
garbage value
After Compilation and execution how many files was created in C Language
1
4
3
2
what is scanf function?
Input
output
abstract
abstract input
>> is which operator?
Relational
logical
bitwise
arithmetic
Which of the following is an invalid assignment operator?
A%=10;
A/=10;
A|=10
none
C Language is developed at ___________?
AT & T's Bell Laboratories of USA in 1972
AT & T's Bell Laboratories of USA in 1970
Sun Microsystems in 1973
Cambridge University in 1972
int main ()
{
int x = 24, y = 39, z = 45;
z = x + y;
y = z - y;
x = z - y;
printf ("%d %d %d", x, y, z);
}
24 36 63
39 24 63
24 39 45
39 24 45
What punctuation is used to indicate the beginning and end of code blocks?
{}
><
BEGIN and END
(and)
C is a ____________ programming language
Object oriented Programming
Procedure oriented Programming
Structured programming language
Structure and Procedure Oriented Programming
. _______________to be included to use standard I/O functions : prinf(),scanf()
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<math.h>
Which is correct example for variable declaration?
int a;b;c;
Int a,b,c;
int a,b,c;
int a,b;c;
Every C statement ends with ------------?
.
;
,
}
What is the extension of C program?
.cpp
.py
.c
.java
A sequence of instructions form a ------------.
Syntax
program
both
none of these
What is correct variable rules in C Language
1. A variable will contain numbers
2. A variable must have underscore
3. A variable will not allow special characters
Both 1&2 follows
Both 1&3 follows
All 1,2&3 follows
Both2&3 follows
What is the correct statement by the following
1. # refers to a preprocessor
2. # will not executes a set of statements before main program executes
3. # allows you to create a macros
Both 1 & 2 follows
Both 1 & 3 follows
All 1, 2 & 3 follows
Both 2 & 3 follows
What is the correct statement by the following
In “scanf” & refers to
1.) Address of a memory location
2.) Operator refers to Address
3.) Syntax for scanning a Variable
4.) All the above
Only 1&2 follows
Both 1&3 follows
Only 3 follows
Only 1 follows
What is the output of the following code
#include<stdio.h>
void main()
{
int a,b,c,d;
a=23;
b=(a--)+(a++);
c=(b--)+(--a);
d=(a+b)-(c—);
printf(“%d%d%d%d”,a,b,c,d);
}
224567-1
234760-2
224667-1
234667-1
What is the output of the following code
#include<stdio.h>
void main()
{
int a,*p;
a=23;
p=&a;
*p=92;
printf(“%d”,++*p);
}
23
93
Compile Time Error
Runtime Error
What is the output of the following code
#include<stdio.h>
void fun()
{
int x=9;
printf(“%d ”,x++);
}
void main()
{
fun();
fun();
fun();
}
10 10 10
10 11 12
9 9 9
9 10 11
What is the output of the following code
#include<stdio.h>
enum COLOR {RED=101,GREEN,YELLOW};
typedef enum COLOR color;
void main()
{
color c;
clrscr();
c=GREEN;
printf("%d",(++c)+(c--));
getch();
}
204
106
206
104
What is the output of the following code
#include<stdio.h>
union MyUnion
{ char c[8]; int a,b; float f;
};
typedef union MyUnion MU;
void main()
{
MU u;
clrscr();
printf("%d",sizeof(u));
getch();
}
8
Compile Error
4
Garbage Value
What is the output of the following code
#include<stdio.h>
void swap(int p,int q)
{
int temp;
temp=*p;
p=q;
*q=temp;
}
void main()
{
int a=10,b=22;
clrscr();
swap(&a,&b);
printf("%d%d",a,b);
getch();
}
10 22
Compile Error
22 10
Garbage Value
What is the output of the following code
#include<stdio.h>
void fun()
{
int a;
printf("%d",a);
a++;
}
void main()
{
clrscr();
fun();
fun();
fun();
getch();
}
Same Garbage Value Three times
Compile Error
Different Garbage Value Three times
Garbage Value
