CP Unit -2 part-1 Questions
1. Define
break and continue statements along with their syntax.
2. Illustrate
with a suitable example the use of return statement.
3. What is the
use of continue key word?
4. Write
syntax of If-else statements.
5. Write
nested if and switch statement syntax
6. Give an
example of iteration statements in C.
7.
Differentiate between while loop and do while
loop.
1. What do you
mean by a loop? Explain the difference between the do loop, while loop, and for
loop with the help of an example.
2. Give a note
on iteration statements in C language.
3. Write a program
in āCā language to print the Fibonacci series. Fibonacci series is 0, 0, 1, 1,
2, 3, 5, 8, 13, 21
4. Explain
switch case statement with an example program.
5. Write a C
program to check whether a given number is Palindrome or not.
6. Explain for
loop statement with syntax with an example.
7. Write an
algorithm to check the given number is perfect number or not.
8. Write an
algorithm to find the roots of a quadratic equation.
9. Illustrate
the concept of different loops in C with syntax and flowchart
10.
Write a program to enter a number and then
calculate the sum of its digits.
11.
Write a program that accepts a number from 1 to
10. Print whether the number is even or odd by using switch case
construct.
12.
Write a C program to check whether a given
number is Armstrong number or not.
13.
Describe the Multi-way selection statements in C
with examples.
14.
Differentiate between else-if and switch
statements with examples.
15.
Explain various branching statements in C with
examples
16.
Design an algorithm to compute n factorial (n! )
where n>=0
17.
Describe the purpose of break and continue
statements in C.
18.
List and explain loop control statements in C.
19.
Why should we avoid using goto statement in
programming? How it is different from continue statement? Explain with
examples.
20.
Write the algorithm to check whether a given
number is prime or not.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home