Computer Science, asked by sunsetvibe123, 4 months ago

Write a program that keeps accepting numbers until 0 is entered. Program execution stops when zero is entered.

Answers

Answered by rajeshwaribhandari37
0

Answer:

C - do while loop, printf ("Sum = %d ", sum); The variables num and sum (both of type int) are used to represent a number entered from keyboard and the sum of the numbers, respectively. Initially, variable sum is initialized to zero and the first number is read in variable num. Write a C program for a menu driven program which has following options: C Program Print Odd Numbers in a given range m to n Add numbers until a negative or zero is encountered

Add numbers until a negative or zero is encountered, C program to add numbers until user enters zero using while loop. 3,517 views3.5K views Duration: 3:18 Posted: Nov 23, 2017 Here is the program to find the total number of positive, negative and zeroes entered. #include<stdio.h> #include<conio.h> main() { int number,totpos=0,totneg=0

C program to add numbers until user enters zero using while loop , Program to add numbers until the user enters zero #include <stdio.h> int main() { double number, sum = 0; // the body of the loop is executed at least once do C programming has three types of loops. // Program to add numbers until the user enters zero #include <stdio.h> int main() { double number, sum = 0; // the body

Ad by Valueimpression

Write a c program to add numbers entered by user until user enters 0

C - do while loop, The program segment given below accepts numbers from the keyboard until we enter a zero or a negative printf("Enter positive numbers (0 or -ve number to stop):\n");. sum Note the use of a scanf statement to read a number before the while loop. C Program Sum of Digits of a Given Integer Number with do-while loop Write a C program for a menu driven program which has following options: C Program Print Odd Numbers in a given range m to n ; Add numbers until a negative or zero is encountered ; Explain control statements those are used in C programming language ; C Program Print a comma-separated list of numbers from 1 to 10

Add numbers until a negative or zero is encountered, C++ program to add numbers entered by user until user enters 0. (DO WHILE LOOP) #include #include void main() { clrscr(); [code]#include <stdio.h> int main(){ int i, s=0; while(scanf("%d", &i) != 0){ if(i == 0) break; s += i; } print(" %d", s); return 0; } [/code]

C++ program to add numbers entered by, Write a C Program to calculate the sum until the user enter positive numbers. loop if(number < 0) break; sum += number; // sum = sum + number i++; if( i>10 ) Here is the program to find the total number of positive, negative and zeroes entered. #include<stdio.h> #include<conio.h> main() { int number,totpos=0,totneg=0

Answered by maanyashvi12
0

Answer:

Java is a program that keeps accepting numbers until 0 is entered. Program execution stops when zero is entered.

Explanation:

Java is a High Level Language

Similar questions