Computer Science, asked by Vintagebroken, 1 year ago

What will be the output and how many times the loop will get executed..

#include iostream.h
void main() {
int num=10,sum=0,i=1;
while(i<=num) {
sum=sum+i;
i++;
}

Answers

Answered by KDstudy
1
The loop will work 10 times.
value of sum=55.
last value of i=11.
But,.... since there is no System.out.print/println statement,you will get no output.

Vintagebroken: U mean there is no cout<
KDstudy: i ment that there is no print statement to display the output
KDstudy: Do you know BLUE J??
Vintagebroken: F9
KDstudy: please mark brainliest
Answered by siddhartharao77
4
The program will be successfully compiled, But it returns no value at runtime. Because you are not printing anything(Cout) (or) return.
Similar questions