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
What are 3 types of structures?
What is null in c?
How can I call fortran?
How important is structure in life?
What is a global variable in c?
What are the modifiers available in c programming language?
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)
What are the c keywords?
What is a node in c?
Which programming language is best for getting job 2020?
How pointer is different from array?
What is the difference between %d and %i?
using for loop sum 2 number of any 4 digit number in c language
What is the acronym for ansi?
How can I handle floating-point exceptions gracefully?