# Q&A Discussions

About the code section?

8 Votes

1 Answer"Conditonal" output

8 Votes

2 AnswersC# program on SoloLearn

8 Votes

2 AnswersIn the short code below, I declared an array of five elements. But I'm getting confused on how to use it in a while loop. My main question is , if the user inputs a userchoice1 value that is less than 1, I want the code to keep looping until the user inputs a number that is not less than 1. But I don't know if the 7th line (userchoice1 [x]++) shows the right way to loop it.

8 Votes

2 AnswersI can not figure this out. Write a program using an array to prompt for 10 grades and add them all up and divide by 10 to find the average. If a user inputs a negative number, add up all the numbers that are not negative and divide it by the amount of numbers that are not negative. Using two functions other than main.

8 Votes

4 Answersin order to find the sum of n numbers given by user,suppose our program is to find the sum of any 4 numbers given by user (using while loop such that (while(i<=4))and incrementing each value of i by 1),if the user give any 2 inputs instead of four then the total sum should be the summation of that two inputs..but the program shows the sum something else,why it is so??

8 Votes

3 AnswersWrite and test a program that solves quadratic equations. A
quadratic equation is an equation of the form ax2+ bx + c =0 ,where a,b and c are given coefficient and x is the unknown The coefficients are real number inputs ,so they should be declared of type float or double Since quadratic equations typically have two solutions ,use x1 and x2 for the solutions to be output These should be declared of type double to avoid inaccuracies from round-off error

8 Votes

3 Answers