Question

3.1. Write a program that asks the user to continue to enter two numbers (at a time). For each pair of numbers entered, the p

This is a C program. please help me to write a pseudocode of the program . also, I want the program In a do...while loop and the screen output should look like in the picture. please help me.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

C program for this is below:

#include<stdio.h>
int main()
{
int a,b,sumOfProducts=0,product;
do
{
printf("Enter two integers: ");
scanf("%d%d",&a,&b);
printf("You entered %d %d\n",a,b);
if(a==0&&b==0)
break;
product=a*b;
sumOfProducts=sumOfProducts+product;
printf("%d * %d = %d; sum of products = %d\n",a,b,product,sumOfProducts);
}
while(a!=0 && b!=0);

return 0;
}

Output screen is attached, I tried the same as yours.

Enter two integers: 11 4 You entered 11 4 11 * 4 = 44; sum of products = 44 Enter two integers: 22 5 You entered 22 5 22 * 5

The pseudo code for the above is:

In the body of do while:

1. take inputs from user

2. display them

3. Use if condition to check whether in the first attempt user has not entered 0 0(if entered then break because do while loop executes atleast ones)

4. calculate product and sum of products

5. display the content

6. repeat process if the numbers are non zero

Please like/upvote my answer. It means a lot to me. If you have any doubts feel free to ask in comments.

Add a comment
Know the answer?
Add Answer to:
This is a C program. please help me to write a pseudocode of the program ....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hi please help me with this zybooks question asap. Thanks 4.17 Chapter 4 Program: Sum of...

    Hi please help me with this zybooks question asap. Thanks 4.17 Chapter 4 Program: Sum of Numbers/C++ program Write a C ++ program that asks the user for a positive integer value by prompting "Enter a positive integer number: ", read in that number, then use a loop to get the sum of all the integers from 1 up to the number entered. For example, if the user enters 50, the loop will find the sum of 1, 2,3, 4…50....

  • In Java, write a program using a loop that asks the user to enter a series...

    In Java, write a program using a loop that asks the user to enter a series of decimal numbers. The user must enter -88 to end the input of the decimal numbers. After the user enters all numbers, the program should display the sum of all numbers entered.

  • Can you help me write a Python 3.7 code for this question? Write a program using...

    Can you help me write a Python 3.7 code for this question? Write a program using functions and mainline logic which prompts the user to enter a number, then generates that number of random integers and stores them in a list. It should then display the following data to back to the user: The list of integers The lowest number in the list The highest number in the list The total sum of all the numbers in the list The...

  • Can someone please help me with this problem? We are using CodeWarrior to write this program...

    Can someone please help me with this problem? We are using CodeWarrior to write this program in assembly language. The array sample contains eight 8-bit signed binary numbers (integers) as shown below. Write a program which stores the negative numbers in the array nelements, computes the sum of the positive numbens to be stored in the variable psum and stores the number of the positive numbers in the variable pnumber. Note that a zero is ther positive nor negative. Your...

  • 1. (sumFrom1.cpp) Write a program that will ask the user for a positive integer value. The...

    1. (sumFrom1.cpp) Write a program that will ask the user for a positive integer value. The program should use the for loop to get the sum of all the integers from 1 up to the number entered. For example, if the user enters 50, the loop will find the sum of 1, 2, 3, 4, ... 50. If the user enters a zero or negative number, a message should be given and the program should not continue (see Sample Run...

  • Write a c++ complete program to meet the specifications. The program should prompt the user for...

    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...

  • need help!! c++ HW_6b - Calculate the average Use a do-while loop Write a program that...

    need help!! c++ HW_6b - Calculate the average Use a do-while loop Write a program that first prompts the user for an upper limit: Enter the number of entries: 5 € (user enters 5) After the user enters a number, the program should prompt the user to enter that many numbers. For example, if the user enters 5, then the program will ask the user to enter 5 values. Use a do-while loop to add the numbers. o With each...

  • using Eclipse c++ Write a program that mimics a simple integer calculator using the switch statement....

    using Eclipse c++ Write a program that mimics a simple integer calculator using the switch statement. The program should prompt for two integer numbers and the operation to be performed as input. It should then output the numbers, the operator, and the results as illustrated below. Use a for loop to prompt the user for input seven times as illustrated below. Assume that the operands will always be valid integers. For division,the program should also output the remainder and check...

  • Prepare pseudocode for a program that lets a user continuously enter numbers until the number 99...

    Prepare pseudocode for a program that lets a user continuously enter numbers until the number 99 is entered. Once the user has stopped entering numbers, display the number of numbers entered AND the sum of those numbers. You'll need a counter and an accumulator for this . Make sure your loop is structured Don't forget to comment your code. Don't forget to display appropriate prompts when requesting input from the user. Use a NAMED CONSTANT for the constant in this...

  • Write a program that reads integers ,one per line and displays their sum .Also display all...

    Write a program that reads integers ,one per line and displays their sum .Also display all the numbers read ,each with an annotation giving its percentage contribution to the sum. Use a method that takes the entire array as one argument and returns the sum of the numbers in the array. Hint: Ask user the user for the number of integers to be entered, create an array of that length ,and then fill the array with the integers read. A...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT