answersLogoWhite

0

write a program in C that prompts the user with the following lines:

a) Add two integers

c) Compare two integers for the larger

t) Test an integers for odd or even

q) Quit

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you find sum of 100 numbers using fortran programme?

The following is for F95 and later (due to the use of intrinsic SUM ): My assumptions: -Your numbers are integers -Your numbers are stored in an array -The numbers you are describing are 0-100 program findSum !I assumed integer, replace this with your data type integer, dimension(100) :: numbers integer :: sumOfNumbers !We populate an array with our numbers !Replace this with your numbers do i=1,(size(numbers)+1) numbers = i end do !We find the sum of those numbers sumOfNumbers = sum(numbers) !We write out the sum to prompt write(*,*) 'Sum is: ', sumOfNumbers end program findSum


Write a program that converts a decimal number to nearest integer?

prompt x floor(x + .5) -> x disp x


Write a C program that prompts the user for three decimal numbers and prints them trimmed as integer values. For example, if the user informs the values 13.2, 12.5, 102.231, the program prints out 13, 12, 102?

Here's a simple C program that prompts the user for three decimal numbers, converts them to integers, and prints the trimmed integer values: c Copy code #include int main() { double num1, num2, num3; // Prompt the user for three decimal numbers printf("Enter three decimal numbers: "); scanf("%lf %lf %lf", &num1, &num2, &num3); // Convert and print the trimmed integer values int intNum1 = (int)num1; int intNum2 = (int)num2; int intNum3 = (int)num3; printf("Trimmed integer values: %d, %d, %d\n", intNum1, intNum2, intNum3); return 0; } In this program: We declare three variables num1, num2, and num3 to store the decimal numbers entered by the user. We use printf to prompt the user to enter three decimal numbers. We use scanf to read and store the user's input in the variables num1, num2, and num3. We then convert these decimal numbers to integers by casting them using (int) and store them in intNum1, intNum2, and intNum3. Finally, we use printf again to print the trimmed integer values. Compile and run the program, and it will prompt you for three decimal numbers and print their trimmed integer values as requested.


Which type of task you can perform in the EDIT prompt can we make the program in it.?

you can perform in the edit prompt? can we make the programme in it?


Which types of task you can perform in the edit prompt can we make the program in it?

you can perform in the edit prompt? can we make the programme in it?


What is the abbreviation for cmd?

CMD stands for Comand Prompt. It is a program found in Microsoft Windows, and can do many things. Command Prompt can be a stand-alone program, or open the .bat file type.


How do you run a DOS program in a window?

you have to use the command prompt(also called the DOS prompt by older users. You can find this by going to "start" , "programs" , "accessories" and "command prompt"


What is the purpose of the command prompt?

the command prompt is a program where you can command the computer to perform functions such as shutdown, restart, open a certain file, start a program, etc.


How to start Firefox from command line?

Install Firefox and run the following command: "cd c:\program files\mozilla firefox" and press enter.. It will give you the prompt - C:\Program Files\Mozilla Firefox> now just execute here "firefox.exe" ..


Certified Prompt Engineer?

Boost your tech and AI career trajectory with our industry-leading Certified Prompt Engineer™ Certification Program.


How do you open a dos command prompt?

Just write the name of that program. For example, if you want to execute abc.exe under c drive then just execute following commands: c:\> abc and press enter.


What windows 9xMe program file provides a command prompt window?

command.com