8. Write a C program that prompts the user to enter 10 positive numbers and calculates the sum of the numbers.

PHOTO EMBED

Sat Jul 22 2023 18:21:12 GMT+0000 (Coordinated Universal Time)

Saved by @Codes

// Online C compiler to run C program online
#include <stdio.h>

int main() {
    int n;
    int sum = 0;
    for(int i = 0; i < 5; i++){
        printf("Enter the number: ");
        scanf("%d", &n);
        n++;
    
    }
    sum = sum + n;
    printf("The sum of 5 postive numbers: %d + %d = %d", n,sum, n+sum);
    
   

    
    return 0;
}
content_copyCOPY