#include
using namespace std;
int main()
{
int pods,beans;
float total;
cout<<''enter the number of pods";
cin>>pods;
cout<<'enter the number of beans";
cin>>beans;
total=pods+beans;
cout<
return 0;
}
function factorial(n) { var x=1; while(n>1) x*=(n--); return x; }
The simplest way is to add a loop around the ask-for-the-number, show-the-table routine. In pseudocode:while (1) { ask-for-the-number; show-the-table; }
write a c++ program to convert binary number to decimal number by using while statement
write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program
Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.
Pseudocode: function calculate() { var hours = prompt("Enter number of hours"); var rate = prompt("Enter rateper hour"); }
prompt x floor(x + .5) -> x disp x
function factorial(n) { var x=1; while(n>1) x*=(n--); return x; }
int first= 1;
Write a program to convert a 2-digit BCD number into hexadecimal
The simplest way is to add a loop around the ask-for-the-number, show-the-table routine. In pseudocode:while (1) { ask-for-the-number; show-the-table; }
just full it up when its at the E
WRITE A PROGRAM TO CONVERT A 2-DIGIT bcd NUMBER INTO HEXADECIMAL
this is what the program says :i want to write a C program which reads in one value, the seed for the random number generator. Your program should then generate 100,000 simulated rolls of a pair of dice. The program should calculate and print the number of times the simulated roll of the dice was a 2, the number of times it was a 7 and the number of times it was a 12. Finally, print out the average (three decimal places) of all of the simulated rolls.Your program must have at least one user defined function called die which creates the roll of one die. This function should return an integer value between 1 and 6 inclusive. It should have no arguments.1- i cant figure out how to calculate how many time does the 2 , 7 , 12 print out .2- how to calculate the number in the 100,000 to be able to calculate the avg.3- i dunno how to create the function in the second part .
program SumAndDifference; var num1, num2, sum, difference: integer; begin write('Enter first number: '); read(num1); write('Enter second number: '); read(num2); sum := num1 + num2; difference := num1 - num2; if sum > difference then written('The sum is greater: ', sum) else written('The difference is greater: ', difference); end. This program will prompt the user to enter two numbers, calculate their sum and difference, and then compare the two values. If the sum is greater than the difference, it will display the sum; otherwise, it will display the difference.
Write a program which takes any number of days from the user. the program should display the number of years, number of months formed by these days as well as the remaining days.
give an example of calculation of mathematics