0% found this document useful (0 votes)
43 views5 pages

Imp C Q On Unit I - II

Uploaded by

ihavecrush55
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)
43 views5 pages

Imp C Q On Unit I - II

Uploaded by

ihavecrush55
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/ 5

FPL: Question Bank

UNIT I: Introduction to programming planning & C programming.


Q1. What is algorithm? Explain with example.
Q2. What is Flowchart? Explain with example.
Q3. Explain the history of C.
Q4. What are the importance of C?
Q5. Write a c program to print your name and address.
Q6. Explain and Enlist Character set in C.
Q7. What is C Tokens?
Q8. What are the Keywords? Enlist.
Q9. What is Identifiers? Enlist rules for Identifiers.
Q10. What is Constants? Explain with syntax and Example.
Q11. Explain variables with syntax and Example.
Q12. What are the data types in C? Enlist & Explain.
Q13. What is the Declaration of Variables?
Q14. What is storage class in C?
Q15. Explain assigning values to variables.
Q16. What is Symbolic Constants in C?
Q17. Explain declaring a variable as Constant.
Q18. Explain declaring a variable as Volatile.

UNIT II: Operators and Expressions.


Q1. What is operators? Enlist.
Q2. What is arithmetic operators? Enlist and Explain.
Q3. Write C program to addition, subtraction, multiplication & division of two numbers.
Q4. Write a C program to calculate area of rectangle by using suitable arithmetic operator.
Q5. Write a C program to calculate perimeter triangle by using suitable arithmetic operator.
Q6. Write a C program to calculate area of circle by using suitable arithmetic operator.
Q7. What is relational operators? Explain with syntax and example.
Q8. What is logical operators? Explain with syntax and example.
Q9. What is assignment operator? Explain example.
Q10. What is increment and decrement operators? Enlist.
Q11. What is conditional operators? Explain.

Q12. What is bitwise operators? Explain.


Q13. What are the special operators in C? Explain.
Q14. Explain the precedence of arithmetic operators?
Q15. Explain Operators associativity in C.
Q16. Explain Mathematical function sort ().
MCQs
1. Who is the father of C language?
a) Steve Jobs
b) James Gosling
c) Dennis Ritchie
d) Rasmus Lerdorf
Answer: c
Explanation: Dennis Ritchie is the father of C Programming Language. C programming
language was developed in 1972 at American Telephone & Telegraph Bell Laboratories of
USA.
2. Which of the following is not a valid C variable name?
a) int number;
b) float rate;
c) int variable_count;
d) int $main;
Answer: d
Explanation: Since only underscore and no other special character is allowed in a variable name,
it results in an error.
3. All keywords in C are in ____________
a) LowerCase letters
b) UpperCase letters
c) CamelCase letters
d) None of the mentioned
Answer: a
Explanation: None.
4. Which of the following is true for variable names in C?
a) They can contain alphanumeric characters as well as special characters
b) It is not an error to declare a variable to be one of the keywords(like goto, static)
c) Variable names cannot start with a digit
d) Variable can be of any length
Answer: c
Explanation: According to the syntax for C variable name, it cannot start with a digit.
5. Which is valid C expression?
a) int my_num = 100,000;
b) int my_num = 100000;
c) int my num = 1000;
d) int $my_num = 10000;
Answer: b
Explanation: Space, comma and $ cannot be used in a variable name.
6. Which of the following cannot be a variable name in C?
a) volatile
b) true
c) friend
d) export
Answer: a
Explanation: volatile is C keyword.
7. What is the result of logical or relational expression in C?
a) True or False
b) 0 or 1
c) 0 if an expression is false and any positive number if an expression is true
d) None of the mentioned
Answer: b
Explanation: None.

8. What is #include <stdio.h>?


a) Preprocessor directive
b) Inclusion directive
c) File inclusion directive
d) None of the mentioned
Answer: a
Explanation: None.
9. The C-preprocessors are specified with _________ symbol.
a) #
b) $
c) ” ”
d) &
Answer: a
Explanation: The C-preprocessors are specified with # symbol.
10. scanf() is a predefined function in______header file.
a) stdlib. h
b) ctype. h
c) stdio. h
d) stdarg. H
Answer: c
Explanation: scanf() is a predefined function in "stdio.h" header file.printf and scanf() carry out
input and output functions in C. These functions statements are present in the header file stdio.h.
11. What will be the output of the following C code?

1. #include <stdio.h>
2. int main()
3. {
4. signed char chr;
5. chr = 128;
6. printf("%d\n", chr);
7. return 0;
8. }

a) 128
b) -128
c) Depends on the compiler
d) None of the mentioned
Answer: b
Explanation: The range of signed character is from -128 to +127. Since we are assigning a value
of 128 to the variable ‘chr’, the result will be negative. 128 in binary is represented as “1000
0000” for character datatype. As you can see that the sign bit is set to 1, followed by 7 zeros (0),
its final decimal value will be -128 (negative 128).
Output: -128
12. What is the precedence of arithmetic operators (from highest to lowest)?
a) %, *, /, +, –
b) %, +, /, *, –
c) +, -, %, *, /
d) %, +, -, *, /

Answer: a
Explanation: None.

13. Which of the following is not an arithmetic operation?


a) a * = 10;
b) a / = 10;
c) a ! = 10;
d) a % = 10;

Answer: c
Explanation: None.

14. Which among the following are the fundamental arithmetic operators, i.e, performing the
desired operation can be done using that operator only?
a) +, –
b) +, -, %
c) +, -, *, /
d) +, -, *, /, %

Answer: a
Explanation: None.
15. What will be the output of the following C code?

1. #include <stdio.h>
2. int main()
3. {
4. int a = 10;
5. double b = 5.6;
6. int c;
7. c = a + b;
8. printf("%d", c);
9. }
a) 15
b) 16
c) 15.6
d) 10

Answer: a
Explanation: None.

You might also like