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

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

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

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

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

  • NOTE: Write the Program in python as mentioned below and use while loop and flags as...

    NOTE: Write the Program in python as mentioned below and use while loop and flags as necessary. And please write the code following the program description given below. DON'T use Function concept or any other concept except while loop,if-else. Directions: Read the program description below carefully. All requirements must be met by your program to receive full credit. Thus, pay particular attention to input and output requirements, structural requirements, and so on. Furthermore, code that contains syntax errors will not...

  • This interactive program focuses on if/else statements, Scanner, and returning values. Turn in a file named...

    This interactive program focuses on if/else statements, Scanner, and returning values. Turn in a file named Budgeter.java. To use a Scanner for console input, you must import java.util.*; in your code. This program prompts a person for income and expense amounts, then calculates their net monthly income. Below are two example logs of execution from the program. This program’s behavior is dependent on the user input (user input is bold and underlined below to make it stand out and differentiate...

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
ADVERTISEMENT