Answer to Question #158132 in C for Farjana Islam

Question #158132

Write a program to evalute the series.

1+3+5+7+........+n


1
Expert's answer
2021-01-25T03:39:43-0500
#include <stdio.h>

int main() {
    int n = 0;
    printf("Input n\n");
    scanf(n);
    for (int i = 0; i < n; ++i) {
        n += i;
    }
    printf("n = %d",&n);
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS