Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Basic C program ve and Odd Entrie ng Loo Simple Conditionals and Us er-defined Function Write a program that repetitively requests integer numbers from the

Basic C program

image text in transcribed

ve and Odd Entrie ng Loo Simple Conditionals and Us er-defined Function Write a program that repetitively requests integer numbers from the user though the keyboard (using printf) and scanf ()) until the user enters 0 when she/he wants to quit. Test each entry for whether the number entered is even or odd. Create two variables that accumulate the values of the numbers entered one for the even numbers and one for the odd numbers. The program shall also ask the name of the user and save it to a string variable. Upon completion of the data entry process (when the user enters 0), the program prints out the name of the user, the number and the sum (cumulative) total of the even numbers entered, and the number and the sum (cumulative) total of the odd numbers entered Use at least one user-defined functions besides main(). Use it to do some non-trivial computations There is no need to save any of the individual values during the program execution- only their cumulative totals and the number of even and odd numbers (separately!) entered. The output should be as follows: , the numbers you have entered are broken down as follows: You entered even numbers with a total value of . You also entered odd numbers with a total value of Where the labels between <..repesent the values of variables that will be printed in its place program specifications: there are several requirements this assignment: your must make use at least one conditional structure matter which loop also have a programmer-defined function besides main scanf to obtain user integer entries. printf print out results screen lastly obviously written c and compile execute correctly on code:blocks using gcc compiler>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions