0% found this document useful (0 votes)
46 views2 pages

UpdatedNew C QB-1

Uploaded by

Kaushik Yash
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)
46 views2 pages

UpdatedNew C QB-1

Uploaded by

Kaushik Yash
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/ 2

I.P. (P.G.

) College Campus-2, Bulandshahr


Department of Computer Science
Programming Principle and Algorithm (BCA -102)
Section- A (Multiple Choice Questions)

1. Which one of the following is a loop construct that will always be executed once?
(a) For (b)while (c) switch (d) do-while
2. Which of the following is not a keyword in C?
(a) int (b) char (c) include (d) float
3. Range of unsigned char is?
(a) 0 to 255 (b) -127 to 128 (c) -128 to 127 (d) 0 to 256
4. What is the size of 'int' data type in C?
(a) 2 bytes (b) 4 bytes (c)8 bytes (d) Depends on the system
5. What does the '==' operator check?
(a) Assignment (b)Equality (c)Greater than (d) Less than
6. How many keywords are there in C?
(a) 32 (b) 45 (c) 23 (d) 67
7. What is a function?
(a) Looping structure (b) Block of code (c) unknown variable (d) None of these
8. Which header file uses gets()?
(a) Stdio.h (b) stdlib.h (c) conio.h (d) None of these
9. In switch statement, each case instance value must be-
(a) Constant (b) Variable (c) Special symbol (d) None of these
10. All preprocessor directives begin with _______ symbol.
(a) $ (b) ^ (c) # (d) @
11. Which one of the following is allowed in variable name?
(a) _(Underscore) (b) *(Astrisk) (c) |(Pipeline) (d) –(Hyphen)
12. Which one of the following is not a logical operator?
(a) && (b) || (c) & (d) !
13. The C programs are converted into machine language with the help of a _____________.
(a) Compiler (b) Editor (c) An OS (d) None of these
14. In C Program, ‘\t’ is used for-
(a) New line (b) Vertical tab (c) Horizontal tab (d) Back space
15. Who is the father of C Language?
(a) Dennis Ritchie (b) James Gosling (c) Steve Jobs (d) None of these
16. What is the syntax for multi line comment in C?
(a) // (b) */….*/ (c) /*…../* (d) /*……*/
17. What is sizeof() in C?
(a) Operator (b) macro (c) Function (d) None of these
18. ________ is an exit-controlled loop.
(a) For (b) while (c) do-while (d) None of these
19. 'const’ data types are used for?
(a) Unknown values (b) Constant Values (c) Dynamic variable values (d) None of these
20. #include<stdio.h> is a ________ directive.
(a) Macro Expansion (b) File Inclusion (c) Conditional Compilation (d) None of these
21. We cannot use the keyword ‘break; simply within_______.
(a) For (b) while (c) do-while (d) if-else
22. In which year, was C Language developed?
(a) 1972 (b) 1978 (c) 1980 (d) 1987
23. What is the default value of a static variable?
(a) 0 (b) 1 (c) garbage Value (d) None of these
24. To clear the output screen, which function is used?
(a) clrscn() (b) clrscrn() (c) crlscr() (d) clrscr()
25. _____ format specifier is used for unsigned integer.
(a) %ld (b) %ud (c) %u (d) %e
True / False-
26. The types of actual and formal arguments must be the same. (T/F)
27. gets () is an unformatted console I/O function. (T/F)
28. The preprocessor directives must end with a semicolon. (T/F)
29. In nested if statement we may have multiple else statements. (T/F)
30. While is an exit controlled loop. (T/F)

Short Answer Questions


1. Explain the use of break and continue in looping with suitable example.
2. What is a loop? How can a do-while loop vary from while loop?
3. Explain static and register storage class with suitable example.
4. Write a program in C language to find the maximum of 3 numbers.
5. What is the use of getch(), getchar() and putchar() function in c ?
6. Write short note on any two-
(i)Recursion (ii)Compiler (iii) If-else statement

Long Answer Questions


1. (a)Explain Trial and Error technique in detail.
(b)Write short note on any three-
(i)Header Files (ii)Flowchart
(iii)Data types (iv)Time Complexity
2. Define Algorithm. Explain characteristics of an algorithm. Write an algorithm to compute sum
of digits of a number.
3. (a)Write a c program to check whether a given number is prime or not.
(b)Write a c program to calculate factorial of a number.
4. (a)Write a c program to calculate Fibonacci Series.
(b)Write a c program to print reverse of n digit number.
5. What do you mean by call by value and call by reference? Explain both in brief, also explain
difference between call by value and call by reference.
6. What is an operator? Explain different types of operators in C.

You might also like