Answer to Question #308228 in C for ahmed

Question #308228

Print sum of first 100 integers. (With data validation)


1
Expert's answer
2022-03-14T02:37:30-0400


#include <stdio.h>






int main()
{
	int sum=0,i;
	for(i=1;i<=100;i++){
		sum+=i;
	}


	printf("The sum of first 100 integers is %d\n\n",sum);


	scanf("%d", &sum);
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS