0% found this document useful (0 votes)
7 views7 pages

Unit-1-PPS Answers_SRM_UNIVERSITY

The document contains a series of multiple-choice questions related to the C programming language, covering topics such as operators, data types, control statements, and syntax. Additionally, it includes programming tasks and explanations about C tokens, input/output functions, and algorithms for calculating areas and factorials. The questions and tasks aim to assess knowledge and skills in C programming.

Uploaded by

phoenixdreamerx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views7 pages

Unit-1-PPS Answers_SRM_UNIVERSITY

The document contains a series of multiple-choice questions related to the C programming language, covering topics such as operators, data types, control statements, and syntax. Additionally, it includes programming tasks and explanations about C tokens, input/output functions, and algorithms for calculating areas and factorials. The questions and tasks aim to assess knowledge and skills in C programming.

Uploaded by

phoenixdreamerx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

1.Name the Sizeof() In C?

A. Operator B. Function C. Macro D. Data type

2.Bitwise Operators Can Operate Upon?


A. Double And Chars B. Floats And Doubles
C. Int And Floats D. Int And Chars

3.C Tokens may be defines as?


A. The Smallest Individual Units Of C Program
B. The Largest Individual Units Of Program
C. Identifiers D. Constant

4.Which Operators Are Known As Ternary Operator?


A. ::, ?. B. ?, : C. ?, ;; D. //?

5.The Correct Order Of Precedence In C


A. Addition, Division, Modulus B. Addition, Modulus, Division
C. Multiplication, Subtraction, Modulus D. Modulus, Multiplication, Subtraction

6.In Switch Statement, Each Case Instance Value Must Be _______?


A. Constant B. Variable C. Special Symbol D. Token

7.The Work Of Break Keyword…………….?


A. Halt Execution Of Program B. Restart Execution Of Program
C. Exit From Loop Or Switch Statement D. Default

8.How many times C.com is printed?


int main()
{
int a = 0;
while(a++ < 5)
printf("C.com");
return 0;
}
A. 5 times B. 4 times C. 3 times D. 1 times

9.How many times C.com is printed?


int main()
{
int a = 5;
while(--a< 1)
printf("C.com");
return 0;
}
A. 5 times B. 4 times C. 3 times D. 1 times

10The output of below program? Hello is printed…..


int main()
{
int i;
for(i=0; i<5; ++;i++)
{
printf("Hello");
}
return 0;
}
A. 5 times B. Compilation Error C. 2 times D. 3 times

11.The invalid header file in C………….?


A. math.h B. mathio.h C. string.h D. ctype.h

12.What Is The Work Of Break Keyword?


A. Halt Execution Of Program B. Restart Execution Of Program
C. Exit From Loop Or Switch Statement D. new line

13.How long the following loop runs?


for(x=0;x=3;x++)
a) Three times b) Four times c) Forever d) Zero

14.Int Main()
{
Extern Int I;
I = 20;
Printf("%d", Sizeof(I));
Return 0;
}
A. 20 B. 2 C. Undefined Reference to I D. Linking Error

15.Set of consecutive memory locations is called as _______.


A. Function B. Array C. Loop D. Pointer

16.Array can be considered as set of elements stored in consecutive memory locations


but having __________.
A. Same Data Type B. Same Scope C. character D. Different Data Type

17.If we have declared an array described int arr[6]; then which of the following array
index is considered as last array index ?
A. 6 B. 4 C. 0 D. 5

18.Which bitwise operator is suitable for turning off a particular bit in a number?
a) && b) & c) << d) !

19.Which of the following statements should be used to obtain a remainder after


dividing 3.14 by 2.1?
a) rem=3.14%2.1; B.rem=modf(3.14,);;
c) rem=fmod(3.14,2.1) d) rem = 3.14 / 2.1);

20.Which of the following special symbol allowed in a variable name?


a) *(asterisk) b)! pipeline c) – (hypen)
d)_(underscore)
21.To print out a=3.14 and b=3.14 given below, which of the following printf()
statement will you use?
a) printf("%f %lf", a, b); b) printf("%Lf %f", a, b);
c) printf("%Lf %Lf", a, b); d) printf("%f %Lf", a, b);

22.Which of the following not belongs to String functions?


strcmp() B. strcat() C.strlen() D. isdigit()

23.The function strcat(S2, S1) appends to


(a) S1,S2 (b) S2,S1 (c) S2,S2 (d) S1,S1

24.Which of the following correctly shows the hierarchy of arithmetic operations in


C?
a) / + * - b) * - / + c) + - / * d) / * + -

25.#include<conio.h> includes
a) Console input/output b) character handing function
c) string function d) date and time functions

26.Global variable known to all functions in the file


a) auto b) intern c) static d) register

27.If c=10,d=5 what is the value of (a,b)


a=c-d--; b=c-d;
a) (5,6) b) (6,5) c) (6,6) d) (6,7)

28.Names defined by programmers for variables, constants and functions are called as
a) identifiers b)keywords
c)data types d)form feed

29.Which escape sequence character indicates newline


a)\t b)\n c)\b d)\0

30.What is the starting point of c program execution?


(a) #include (c) Opening curly braces '{'
(b) void main() (d) None of these

31.How Many Keywords are there in C?


(a) 31 (c) 64 (b) 32 (d) 63

32. Which of the following is not a valid C variable name?


a) int number; c) int variable_count; b) float rate; d) int $main;

33.getch() and putch() belongs to which library of c


(a) stdlib.h (b) stdio.h (c) conio.h (d) stdconio.h

34.Access specifier for double


a) %d b)%c c)%f d)%lf
35.Evaluate the expression 3/2*4+3/8
a)4 b)0 c)24 d)8

36.Which of the following is used to read a string


(a) getchar() (b) gets() (c) getstr() (d) getch()

37.What should be written in the program to get newline on the screen?


(a) printf("\n"); (b) echo"\n" (c) printf('\n'); (d)
printf("\n"):

38.Which of the following is NOT a valid expression in C programming?


a)x + y c) x == y b)b) x = y d) x & y

39.What is the purpose of declaring a variable in C programming?


a) To assign a value to it b) To reserve memory for it
c) To perform operations on it d) To compare it with other variables

40.What is the purpose of the comma operator (,) in C?


a) Separates statements in a block b) Performs addition
c) Performs bitwise AND operation d) Performs exponentiation

41.Which format identifier is used to print a string in C?


a) %d c) %c b) %f d) %s

42.int main()
{ int x=5, y=10;
printf(“%d”, (x>y) && (x+y));
return 0;}
a)0 c)1 b)5 d)10

43.Which of the following is NOT a valid expression in C programming?


c)x + y c) x == y d)b) x = y d) x & y

44.What is the purpose of declaring a variable in C programming?


a) To assign a value to it b) To reserve memory for it
c) To perform operations on it d) To compare it with other variables

45.Which of the following is the correct syntax for copying a string S1 into S2?
(a) strcpy(S2,S1); (b) strcpy(S1,S2);
(c) strcmp(S1.S2); (d) strcmp(S2,S1);

46.Which one of the following is a string constant


(a) ‗3‘ (b) “hello” (c) 30 (d) 1-
1.Write in detail about the evolution of C programming.

2.Nathan works as an HR in a private company. He had an opportunity to


interview students from various disciplines.

He asked the candidates to perform the addition of two floating


point numbers given by him an to print the output with three values
after decimal point. But the student failed a math test on adding two
numbers. So many students could not complete the first round.

One day Nathan is invited as a chief placement trainer in a


reputed engineering college. He willing to know how many
students are capable of solving the same problem.
Can you solve the problem and prove him that you are capable of solving
it?
3. Write an algorithm, flowchart and pseudo code to calculate the area of
circle,triangle
4. write a C program to find the largest number,smallest number

5. Explain C Tokens in detail with appropriate examples and different data types
handled in C.

6. Write a program for bitwise left shift and right shift operator

7. Explain decrement and increment operator with an example

8. Explain the formatted and unformatted input output functions in C

9.write a C program to find the factorial and average of number

10.Give an overview of the basic structure of C program

11. Explain different operators handled in C.

12.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy