Computer Science, asked by leher5115, 11 hours ago

write a program to display sum and product of numbers from 1 to 10​

Answers

Answered by jeevanraj37
0

Answer:

#include <stdio.h>

int main() {

   int n=10,sum=0, product=1;

   for(int i=1;i<=n;i++){

       sum=sum+i;

       product=product*i;

   }

   printf("sum=%d\nproduct=%d\n",sum,product);

   

   return 0;

}

I hope this helps.

Similar questions