Computer Science, asked by shalinivaratharaj4, 5 hours ago

sum of first n odd numbers in c program​

Answers

Answered by Anonymous
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 saimaqaisar507
3

Answer:

Hope that it will help you

Attachments:
Similar questions