C# | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C#

Modify your codes and create a program that will compute and display the following. Enter a number: 2 Enter a number: 8 Enter a number: 3 Enter a number: 6 Enter a number: 0 Total number of non-zero integers: 4 The sum of all numbers inputted: 19 Total numbers of Even integers: 3 Total numbers of Odd integers: 1 (just a hint please😇)

18th May 2021, 4:37 PM
Angelica Aglibot
Angelica Aglibot - avatar
3 Answers
+ 2
Hint: Complete C# course
18th May 2021, 4:42 PM
Michal Doruch
+ 1
Number of inpits are defined Or we just have to take input while user doesn't enter 0
18th May 2021, 4:42 PM
YUGRAJ
+ 1
Take total number of inputs until user press 0 suppose u entered 6 then it will takes 6 input then use loop and write statement to take numbers as a inputs. Take one extra variable sum and initialize with 0 and inside loop use sum =sum+numbers; take one more variable count which will count total numbers and inside loop write if condition to check if number is odd then print those numbers
18th May 2021, 5:03 PM
A S Raghuvanshi
A S Raghuvanshi - avatar