NEW
Font size
WorksheetsC Programming - Quiz
Total questions: 20
Worksheet time: 7mins
Who invented C Language.?
Charles Babbage
Grahambel
Dennis Ritchie
Steve Jobs
Correct way of commenting a single line is.?
/*printf("Hello C..");
//printf("Hello C..");
/*printf("Hello C..");*/
/printf("Hello C..");/
What is output of below program?
int main()
{
int i;
for(i=0; i<5; ++i++)
{
printf("Hello");
}
return 0;
}
Hello is printed 5 times
Compilation Error
Hello is printed 2 times
Hello is printed 3 times
Find an integer constant.
3.145
34
"125"
None of the above
Number of Keywords present in C Language are .?
32
34
62
64
Each statement in a C program should end with.?
Semicolon ;
Colon :
Period . (dot symbol)
None of the above.
_______________to be included to use standard I/O functions : prinf(),scanf()
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<math.h>
________to be included to use mathematical functions sqrt()
#include<conio.h>
#include<string.h>
#include<math.h>
#include<stdio.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 variable must be -------------- before it is used.
executed
defined
declared
identified
Which of the following is not logical operator?
&
&&
||
!
Which of the following is the correct operator to compare two variables?
equal
=
:=
==
The "\n" character does which of the following operations?
Double line spacing
Character deletion
Character backspace
Places cursor on the next line
if two strings are identical then function strcmp() returns
0
-1
true
none of these
str1="6/4";
printf("str1");
6/4
str1
None
What will the output of the following program?
#include <stdio.h>
int main()
{
char str1[] = "College";
char str2[] = "University";
strcpy(str1, str2);
printf("%s", str1);
}
College
University
College University
University College
What is right way to Initialize array?
int num[6] = { 2, 4, 12, 5, 45, 5 };
int n{} = { 2, 4, 12, 5, 45, 5 };
int n{6} = { 2, 4, 12 };
int n(6) = { 2, 4, 12, 5, 45, 5 };
Which is not a built in function
string()
strlen()
strcat()
strcmp()
String is initialized with datatype
float
char
int
double
