Loop & Conditions: 2. Take 2 integers inputs from the keyboard and also ask the user for which operation to perform: +,
Posted: Sat Feb 19, 2022 3:22 pm
Loop & Conditions: 2. Take 2 integers inputs from the keyboard and also ask the user for which operation to perform: +, or " or "* Perform the appropriate operation and show the result. 3. Write a program that takes an integer as input from the user and displays whether the number is even or odd. 4. Write a program that will keep taking inputs from the user until the user inputs - 1. Finally display all numbers and also display all numbers excludes the odd number and find the sum of them. Function: 5. Write a function isPrime(int n) that checks if 'n' is prime or not. Use this function to print all the prime numbers between 300 to 500. 6. Write a function combination(int n, int r) that takes two integers as its parameter and calculates the combination using the formula given below. "Cr = n!/r!(n-r)!