Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

C-fundamental quiz and quesion

1) Which of the following is the first operating system developed using C programming
language?
a. Windows
b. DOS
c. Mac
d. UNIX
2) Which of the following is a logical AND operator?
a. ||
b. !
c. &&
d. None of the above
3) Which format specifier is used for printing double value?
a. %Lf
b. %L
c. %lf
d. None of the above
6) In a library of C programming language, which of the following header file is used for
performing mathematical operations?
a. conio.h
b. dos.h
c. math.h
d. stdio.h
7) What are the various types of real data type in C language?
a. long double, short int
b. float, long double
c. short int, double, long int, float
d. float, double, long double
8) The statement used for printing \n on the screen is:
a. printf("");
b. printf('\n');
c. printf("\\n");
d. printf("n\");
9) Single line comment in C language begins with _______
a. :
b. //
c. */
d. /*
10) Who is known as the founder of C language?
a. James Gosling
b. Martin Richard
c. Brian Kernighan
d. Dennis Ritchie
11) The C variables are case insensitive.
a. True
b. False
12) A character variable can store ___ character(s) at a time.
a. 1
b. 2
c. 0
d. NULL
13) If scanf() statement is used for storing a value in char variable, then along with the value a
carriage return (\r) also gets stored.
a. True
b. False
14) For printing the value of a and b given below, which printf() statement will you use?

#include<stdio.h>
main()
float a=3.14;
double b=3.14;
a. printf("%Lf %f", a, b);
b. printf("%Lf %Lf", a, b);
c. printf("%f %Lf", a, b);
d. printf("%f %lf", a, b);

15) A long integer is at least 32 bits wide and a short integer is at least 16 bits wide
a. True
b. False

16) A char variable can store either a Unicode character or an ASCII character.
a. True
b. False
1) Write a C program that accepts three integers and find the maximum of three.
2) Write a C program to calculate the distance between the two points. Go to the editor
Test Data :
Input x1: 25
Input y1: 15
Input x2: 35
Input y2: 10
Expected Output:
Distance between the said points: 11.1803
3) Write a C program to convert a given integer (in seconds) to hours, minutes and
seconds.
4) Write a C program to convert a given integer (in days) to years, months and days,
assumes that all months have 30 days and all years have 365 days.

You might also like