Lab Assignment - No - 5-1
Lab Assignment - No - 5-1
Q.1 Write a C++ program that takes a number as input and prints its multiplication table up to 10 using a while
loop.
Q.3 Write a C++ program that reads an integer from the user and finds its factorial using a do-while loop.
Q.4 Accept two integer numbers from the user. Accept a character input from the user ('A' or 'S' or 'M' or 'D'
or ‘R’). Check whether only the following characters have been entered. Based on this input, perform
either Addtion, Subtraction, Multiplication, Division, and remainder of the two numbers using switch case.
Q.5 Enter a 3-digit integer number. Check whether the number entered is a palindrome or not. A palindrome
is a number that will read the same from left to right or right to left. E.g. 121, 242, and 676 are examples
of a 3-digit palindrome number. 123, 211, 345, and 322 are examples of numbers that are not palindrome.
Q.6 Write a program that takes the marks of 10 students as input and also takes the subject as input. It
calculates the total marks of each student and the average of individual subjects using a function.
Q.7 Write a C++ program to find the maximum number from any three integers using a ternary operator.