c program to manipulate x=1+3+5+...+n using recursion

Answer Posted / boni ravi

#include<stdio.h>
#include<conio.h>
main()
{
int i,n;
int x=0;
clrscr();
printf("enter n value");
scanf("%d",&n);
for(i=1;i<=n;i=i+2)
{
x=i+x;
}
printf("output is%d",x);
}

Is This Answer Correct ?    9 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are 3 types of structures?

590


What is null in c?

596


How can I call fortran?

640


How important is structure in life?

583


What is a global variable in c?

587






What are the modifiers available in c programming language?

731


pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)

1855


What are the c keywords?

745


What is a node in c?

543


Which programming language is best for getting job 2020?

605


How pointer is different from array?

573


What is the difference between %d and %i?

591


using for loop sum 2 number of any 4 digit number in c language

1729


What is the acronym for ansi?

625


How can I handle floating-point exceptions gracefully?

631