Create a program that will display the sum of all numbers from 1 up to the input number?

1 answer

Answer

1211327

2026-07-27 15:10

+ Follow

to print the sum of first ten numbers:-

void main()

{int i,sum;

sum=0;

while(i<=10)

sum=sum+i;

i=i+1;

}

printf("The sum is : %d",sum);

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.