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 is header file definition?
Write a code of a general series where the next element is the sum of last k terms.
Why c is a mother language?
What are local static variables?
What are loops c?
Explain how do you declare an array that will hold more than 64kb of data?
What are the types of variables in c?
What is character constants?
write a program to find the given number is prime or not
Explain what is wrong with this program statement?
What is selection sort in c?
How does selection sort work in c?
What is the use of void pointer and null pointer in c language?
What is the difference between scanf and fscanf?
write a programming in c to find the sum of all elements in an array through function.