Question

state a. If the variable angle is equal to 90 degree angle; else print the message The an If angle wa 90; hot Cna.. 4) Solve the following questions using a loop as specified in the end of the question. Write a small code snippet meaning you do not need to include libraries, or mention the main function (20 points, 10 points each). a. Generate a loop to produce the following text (use for or whille loop, note that 8 is absent in the output): 6 Find the next! correct value, which is 200, prompt the user to try again and enter another value. Continue to do this until the user has entered the correct value (use do-while loop) b. Prompt the user to solve the equation (22-2) 10, if the user does not enter the
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) // generating even numbers upto 100(assumption)
for(i=2;i<100;i=i+2)
{
// if number is divisible by 8 dont include that number
if(i%8!=0)
printf("%d...\n",i);
}

Output

koushikhp@koushikhpnew: 40) 12:15AM 오 koushikhp ※ koushikhp@koushikhpnew: $ ./a.out 4 14.. 34 38 42.. 46.. 52.. 54 60.. 62..

b)

do
{
printf("Enter value\n");
scanf("%d",&n);
}while(n!=((22-2)*10));

Output

koushikhp@koushikhpnew: 多眷40) 12:20 AM Ikoushikhp koushikhp@koushikhpnew: $ ./a.out Enter value 26 Enter value ter value 85 E

Add a comment
Know the answer?
Add Answer to:
state a. If the variable angle is equal to 90 degree angle"; else print the message...
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
  • Please can someone help me to finish this program? It is a C programming not a...

    Please can someone help me to finish this program? It is a C programming not a C++, when programming the program in linux I keep getting expected expression before || token, also please check if everything else is fine, maybe there is something else worng in my program and may ask me later to fix it, I am concern about the sin and cosine. The program is supposed to do all this: 1.Display a welcome message. 2.Prompt for the height...

  • Update the program in the bottom using C++ to fit the requirements specified in the assignment....

    Update the program in the bottom using C++ to fit the requirements specified in the assignment. Description For this assignment, you will be writing a single program that enters a loop in which each iteration prompts the user for two, single-line inputs. If the text of either one of the inputs is “quit”, the program should immediately exit. If “quit” is not found, each of these lines of input will be treated as a command line to be executed. These...

  • Write a C++ program main.cpp that implements a simple number guessing game with multiple questions /...

    Write a C++ program main.cpp that implements a simple number guessing game with multiple questions / answers. For each game, the program generates a random number between 1 and 10. User enters an answer with a numeric input. If the user input number matches the generated number, then print a message to inform users that he/she has a correct guess. If the guess is not correct, allow the user to have two more chances to guess the correct number. At...

  • Objectives – to practice these new concepts: decision-making with if, if-else, if-else-if-… switch data validation for...

    Objectives – to practice these new concepts: decision-making with if, if-else, if-else-if-… switch data validation for user input using a while (or while/do) loop nicely formatted output report with printf and format strings multiple input data sets using a while (or while/do) loop named constants PROJECT OVERVIEW This project provides a detailed payroll report for the sales staff at TheLaptopShop. The company has 3 tiers of salespeople: low, middle, high (designated by L, M, H) – based on their past...

  • IP requirements: Load an exam Take an exam Show exam results Quit Choice 1: No functionality...

    IP requirements: Load an exam Take an exam Show exam results Quit Choice 1: No functionality change. Load the exam based upon the user's prompt for an exam file. Choice 2: The program should display a single question at a time and prompt the user for an answer. Based upon the answer, it should track the score based upon a successful answer. Once a user answers the question, it should also display the correct answer with an appropriate message (e.g.,...

  • Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate...

    Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate the number of test scores the user enters; have scores fall into a normal distribution for grades -Display all of the generated scores - no more than 10 per line -Calculate and display the average of all scores -Find and display the number of scores above the overall average (previous output) -Find and display the letter grade that corresponds to the average above (overall...

  • IN JAVA Overview In this project you will implement a Java program that will print several...

    IN JAVA Overview In this project you will implement a Java program that will print several shapes and patterns according to uses input. This program will allow the use to select the type (say, rectangle, triangle, or diamond), the size and the fill character for a shape. All operations will be performed based on the user input which will respond to a dynamic menu that will be presented. Specifically, the menu will guide the user to decide between different forms...

  • d. Assumecalories is already declared as an integer.  Code a fall-through switchstatement by dividing calories by 100...

    d. Assumecalories is already declared as an integer.  Code a fall-through switchstatement by dividing calories by 100 in the controlling expression of the switch header, so the following messages print: When caloriesare 1200 through 1800:  “Diet is on target.” When caloriesare 2000 through 2550:  “Calorie intake ok if active.” When caloriesare any other value:  “Calorie intake is either insufficient or too much!” e. Re-code 1d using double-selection ifs.  You’ll use a conditional logical operator to join the sets of relational conditions (choose the right one).  ...

  • PLEASE USE ECLIPSE AND INCLUDE A READABLE COPY OF YOUR OUTPUT FOR THE FOLLOWING PROBLEM. IT...

    PLEASE USE ECLIPSE AND INCLUDE A READABLE COPY OF YOUR OUTPUT FOR THE FOLLOWING PROBLEM. IT IS VERY IMPORTANT TO USE ECLIPSE AND NOT SOMETHING ELSE TO WRITE THE REQUIRED C++ PROGRAM. THANK YOU. Design Specifications: Write a C++ function named inches_ to centimeters (). This function accepts one variable of type float that represents the value of inches, and returns one variable of type float that represents the equivalent number of centimeters. Use the relationship that 1 inch 2.54...

  • Question 3.1 Draw the class diagram for the ATM program in Question 2.1. Please find attached...

    Question 3.1 Draw the class diagram for the ATM program in Question 2.1. Please find attached the scenario in the photos. this is for programming logic and design Scenario A local bank intends to install a new automated teller machine (ATM) to allow users (i.e., bank customers) to perform basic financial transactions (see below figure). Each user can have only one account at the bank. ATM users should be able to do the following; View their account balance. Withdraw cash...

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