write a program to display sum and product of numbers from 1 to 10
Answers
Answered by
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
English,
6 hours ago
Psychology,
6 hours ago
History,
11 hours ago
Chemistry,
11 hours ago
Accountancy,
8 months ago
Science,
8 months ago
Geography,
8 months ago