For each of the following problems, design the flowchart and the pseudo-code. a)
ID: 3928082 • Letter: F
Question
Explanation / Answer
C. A program to find the sum of Natural Numbers :-
#include<stdio.h>
int main()
{
int n, i;
int S = 0;
printf("Enter a positive Integer to compute the sum ") ;
scanf("%d", &n) ;
for(i = 1; i <= n; i++)
{
S = S + i;
}
printf("The Sum of Natural Numbers is = %d", S) ;
return 0 ;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.