ATTEMPT ANY 20 Questions
1.Which of the following are invalid variable names and why?
Minimum
[Link]
Row Total
&name
Doubles
3rd_row
Column-total
float
Why it is necessary to have a knowledge of data type in
programming.
2.How can you declare the following variables using suitable data
types? Mobile phone numbers, address, body temperature,
salary. Also explain each memory occupancy, size and range.
3.What are different data types available in C? Explain their type’s
qualifier, conversion character, range of value and storage size in
memory occupied by each type.
4.What is an operator? Explain the conditional operator with
suitable examples.
5.Explain the arithmetic, relational, logical and assignment
operators in C language.
6.Describe the unary operator, binary operator and ternary
operator with examples.
7.What are the rules for naming identifiers? Why do we need
different data types in programming? Differentiate between local
and global variables with suitable examples.
8.What is the purpose of qualifiers - register and volatile? How
could you extend the range of values they represent?
9.Mention the appropriate data type for storing following data. Also
justify your answer in brief.
istance jumped by a frog
D
A prime number between 5 and 555.
Weight of your body.
The examination symbol number of a student.
10. What is operator precedence and associativity in C ?
11. Describe the working of for loop and while loop with flowchart
and examples.
12. Explain with examples the decision control mechanism and
loop control mechanisms available in c?
13. Explain entry control and exit control loop with examples?
14. Write a program to find the terms in the given series till the
term value is less than 250.
(12+22)/3, (22+32)/4, (32+42)/5,.............................
15. Write a flowchart and program to compute tax amount when
income is given considering the following tax table:
16. Write a menu driven program having the given menu.
Main Menu
1. To print factorial of a number
2. To reverse an integer array
3. Exit
Please select your choice (1 to 3):……………………….
Note: The program should continue the execution till 3 is not
selected
17. Write a program to calculate the sum of a given series, up to
the term given by the user.
18. Write a program to display the following menu:
MENU
i. To check if the given number is odd or even
ii. To find the sum of N numbers
iii. To find the sum of squares of two numbers
iv. Exit from program
And perform tasks as per user’s choice until the user wants to
exit.
19. What do you mean by selective and repetitive statements?
Why do we need a break and a continue statement?
20. Write a program for the Armstrong number between 100 to
999.
21. Differentiate between break and continue statements with
examples.
22. WAP to print Fibonacci Sequence of given terms.
23. WAP to print half pyramid using alphabets
A
B B
C C C
D D D D
E E E E E
24. WAP to print inverted half pyramid using * .
* * * * *
* * * *
* * *
* *
*
25. WAP to print full pyramid using *.
26. WAP to print Pascal's triangle.
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1