Krishna Institute of
Management & Technology, Moradabad
Computer Concepts & Programming
Assignment-3
1. What is control
statement? Give example.
2. When you
choose the for loop and do-while loop? How for is
different from while loop?
3. What is recursion?
Give example.
4. Explain the difference between call by value and call by reference by using suitable example
5. How can define a function?
6. Write short on the following:-
(a) break and continue (b) nested if ,else if (c) switch
(d) return (e) formal and actual parameters
7. Write a program to read the grades A,B,C,D & F & print excellent, good, fair, poor and failure using if-else and switch statement
8. Write a program to print the Pascal triangle .
9. Write a program to calculate the factorial of a given number.
10. Write a program to find the real imaginary root of a quadratic equation.
11. Write a program to generate a Fibonacci series (0,1,1,2,3,5,8,13…..)
12. Write a program to find the largest and smallest number in a given range.
13. Write a program to print the tables from 11 to 20.
14. Write a program to calculate the square and cube of a given number using function.
15. Write a program to find factorial of a number:
a. Using without argument and without return function
b. Using without argument and with return function
c. Using with argument and without return function
16. Write a program to find sum of two numbers using with argument and with return function.
17. Write a program to check a number is Armstrong number or not.
153=(1x1x1)+(5x5x5)+(3x3x3) = 153
18. Write a program to find factorial of a number through recursion
19. Write a program to enter 10 number then find the sum of odd and even number.
20. Write a program to reverse a number and the check palindrome and count no count of digits.
21. Write a program to find gcd and lcm of two number.
22. Write a program to check prime number.
23. Write a program to enter sum number then print sum of all those number whose last digit is not completely divisible by 7.
24. Write a program to convert :
(a) decimal to binary (b) decimal to octal (c)binary to octal (d)octal to decimal (b)binary to octal.
25. Write a program to print.
(a) * (b) *** (c)1
** ** 12
***
* 123