1. Explain the following control structures with one example each.
(a) If
(b) If-else
(c) While
(d) For
(e) switch
2. Write the algorithm, the flow chart, and the C++ program for printing the sum of odd numbers for a given maximum number.
3. Write the algorithm, the flow chart, and the C++ program to check whether the given input number is prime number or not.
(a) If
(b) If-else
(c) While
(d) For
(e) switch
2. Write the algorithm, the flow chart, and the C++ program for printing the sum of odd numbers for a given maximum number.
3. Write the algorithm, the flow chart, and the C++ program to check whether the given input number is prime number or not.
تعليق