Sunday, April 17, 2016

QB-Unit 3

2 MARKS

1.      What are decision control structures in ‘C’?
2.      Name any two pre-test loops.
3.      What is the difference between while and do-while loop?
4.      How can we use ‘for’ loop when the number of iterations is not known?
5.      What is the difference between break and continue in’C’? Explain taking an example.
6.      What do you understand by modular programming?
7.      What is the need of functions?
8.      What is a function prototype? Why is it required?
9.      What is the difference between formal parameters and actual parameters?
10.  What is the difference between recursion and iteration?

5 MARKS

1.      Describe the types of looping statements in ‘C’ with necessary syntax.
2.      Differentiate between nested if and switch statements in ‘C’ with example.
3.      W.A.P. to design a calculator that can add, subtract multiply and divide any two numbers using switch case.
4.      Write a program in ‘C’ to read an integer number from keyword, add 1 to it if the number read is even, again add 1 to it if the number is less than 20, otherwise keep the number unchanged and print the final result.
5.      Given a number write a program in ‘C’ using while loop to reverse the digits of the number. For example, the number 12345 should be outputted as 54321.
6.      Write a program in ‘C’
a.       To find the largest among given 3 numbers
b.      To find the sum of the digits of a number
c.       To find sum of even and odd numbers from first 100 integers
d.      To find whether a number is prime or not.
e.       To generate 10 Fibonacci numbers
7.      Write a program in ‘C’ to print the following pattern”
1
2    3
4    5          6
7    8          9          10

8.      Discuss the different types of functions used in ‘C’ language.
9.      Write a program in ‘C’ to calculate the area and perimeter of a circle for a given radius using user defined single function which returns area and perimeter to the main function.
10.  What is recursion? Write a C program to find the factorial of a given number using recursion.
11.  Write a program in C to generate Fibonacci series (0  1  1  2  3  5  8….) using recursive function.
12.  What is the difference between ‘call by value’ and ‘call by reference’? explain with an example.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.