1. Write a complete C++ program to calculate the power of two for any integer number is input from the keyboard. Then, when that is done write a complete C++ program to calculate a table of factorials [user supplies the height]

#include <iostream>
using namespace std;
int powerOf2(int n) {
if (n == 0) {
return 1;
} else {
return 2*powerOf2(n-1);
}
}
int main() {
int n;
cout << "Enter a positive integer: ";
cin >> n;
cout << "2 power " << n << " is " << powerOf2(n) << endl;
return 0;
}


#include <iostream>
using namespace std;
int main() {
int n;
cout << "Enter a positive integer: ";
cin >> n;
cout << "n\t\tfactorial" << endl;
int f = 1;
for (int i = 1; i <= n; ++i) {
f *= i;
cout << i << "\t\t" << f << endl;
}
return 0;
}

1. Write a complete C++ program to calculate the power of two for any integer number...
Program : Write a complete C++ program that Input: Read a positive integer from the keyboard (user) with proper prompt text and save it to a variable. The integer have up to five digits. Processing: From the right most digit, extract every digit from the input integer using modular operator %then save the digit to a separate variable. Remove the right most digit from the integer using integer division operator /. Repeat above two steps till all digits have been...
USING C# 1. Write a program that takes outputs a string, an integer and a floating-point number separated by commas. Sample output: Bob Marley, 20, 5.2 2. 2. Write a program that asks the user for a string of letters of any size (no spaces), and finally a special character (values 33 to 47 in the Ascii table, or ‘!’ to ‘/’). Generate a random number of any size, integer or floating point, and combine those three pieces of information...
C++ Write a program that prompts the user to enter two positive integers: num1 and num2. - Validate that num1 is less than num2 and that both numbers are positive. If any of these conditions are not met, allow the user to re-enter num1 and num2 until the input is determined valid. - For all integers from num1 through num2, print the word keyboard if the current integer is divisible by 2 and print the word mouse if the current...
Write a complete C program with a helper function that reads an integer from the keyboard and prints its factorial to the standard output
Your
program write
a program to test whether a number is prime or not.
Your program should
ask user to input an integer and respond: "Prime" or "Not
prime".
Don't use any
library function that tests for prime numbers.
The program should
continue to ask for input, till it sees a 0, when it exits.
Please submit printed
pseudocodeshould ask user to input an
integer and respond: "Prime" or "Not prime".
Don't use any library function that tests for prime numbers....
Write a c++ complete program to meet the specifications. The program should prompt the user for a positive integer. The program should print a message whether the integer is even or odd. The looping should end when the user enters a negative number. The negative number will not be tested for even or odd. The program will print out a message of how many numbers were entered (not counting the negative number) and how many even and odd numbers were...
1. Write a program that takes a number as input and check whether the number is positive, negative or zero. 2. Write a C++ program that prompts the user to enter a number and checks whether the entered number is even or odd. 3. Using switch-case statement write a C++ program that prompts the user to enter 1, 2 or 3 and display "Red" if selection is 1, "Yellow" if selection is 2, or "Green" if selection is 3. 4. Write...
1) Write a program that: program starts; declares and initializes to zero an integer variable score; declares and initializes to zero a float variable total; uses a for loop statement with integer x initialized to 1 going 5 iterations hence x<5 incremented by 0; input from keyboard integer score in range of 0 to 99; print on new line input value; adds score to total; switch x equals 3 break default x++; after exiting the loop calculate the average score;...
Language is C
1. Palindrome Write a program that prompts the user for a positive integer number and output whether the number is a palindrome or not. A palindrome number is a number that is the same when reversed. For example, 12321 is a palindrome; 1234 is not a palindromoe. You will write a function named as palindrome. The function will have two arguments, number and isPalindrome. Both arguments are pass-by-reference. The argument number is a pointer to a variable...
PYTHON Write a program that converts a total number of seconds to hours, minutes, and seconds. It should (1) prompt the user for input, (2) read an integer from the keyboard, (3) and calculate the result. For example, "5000 seconds = 1 hours, 23 minutes, and 20 seconds". Hint: Use the modulus operator.