Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in C, thank you. 3. Write a program to find out how many of the numbers from 1 to 100 are greater than 31,

Write in C, thank you.

image text in transcribed

3. Write a program to find out how many of the numbers from 1 to 100 are greater than 31, and find the sum of the natural numbers that are greater than 31. a. The program should have a loop which steps a variable (probably named i) over the 100 numbers. b. Hint: Inside the loop, if i is greater than 31, add 1 to a second variable (probably named count) which keeps track of total number of integers that are greater than 31, and add i to a third variable which keeps track of the sum. At the end of the program, after the loop has finished, print out the count and sum. c. The expected output (The sum might be wrong): The are 69 numbers from 1 to 100 are greater than 31. The sum of these 79 number is 1234

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions