sum of first n odd numbers in c program
Answers
Answered by
3
Answer:
Hope it's helpful for you
Explanation:
#include <stdio.h>
int main()
{
int i, n, sum=0;
printf("Enter upper limit: ");
scanf("%d", &n);
for(i=1; i<=n; i+=2)
{
sum += i;
}
printf("Sum of odd numbers = %d", sum);
return 0;
}
#its Sayan✌
Answered by
3
Answer:
Hope that it will help you
Attachments:
Similar questions
Physics,
1 month ago
Biology,
2 months ago
History,
9 months ago
Computer Science,
9 months ago
Math,
9 months ago