Computer Science, asked by GTVIDHAAN, 2 months ago

Q2. To find the sum of 100 natural numbers.
________________________
don't spam​

Answers

Answered by VIVAANSINGHBISHT
1

Answer:

*

* C program to find the sum of 'N' natural numbers

*/

#include <stdio.h>

void main()

{

int i, num, sum = 0;

printf("Enter an integer number \n");

scanf ("%d", &num);

for (i = 1; i <= num; i++)

{

sum = sum + i;

}

printf ("Sum of first %d natural numbers = %d\n", num, sum);

}

Answered by dangedhanaji80
1

Explanation:

HEY BEAINLYMATE HERE IS YOUR ANSWER

Attachments:
Similar questions