Differentiate between while loop and do while loop. Write a C program to find input number is prime or composite.
Marks: 5Chapter: Unit 6: Control Structure (6Hrs)
Comprehensive questions and detailed answers for Unit 6: Control Structure (6Hrs). Perfect for exam preparation and concept clarity.
Differentiate between while loop and do while loop. Write a C program to find input number is prime or composite.
Write a program to print the following pattern using loop.
U
UN
UNI
UNIV
UNIVE
UNIVER
UNIVERS
UNIVERSI
UNIVERSIT
UNIVERSITY
Write a C program to generate the following output using loop.
1 0 1 0 1
0 1 0 1
1 0 1
0 1
1
Write a program in C to find all possible roots of quadratic equation ax² + bx + c = 0.
Is break keyword mandatory in switch statement? Write a program to calculate arithmetic operations (+, -, *, /) using switch case statement.