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 modeling?
What is the difference between null pointer and wild pointer?
What is the purpose of type declarations?
Which built-in library function can be used to match a patter from the string?
What is the maximum no. of arguments that can be given in a command line in C.?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
What is the difference between constant pointer and constant variable?
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
How can I read data from data files with particular formats?
What are volatile variables in c?
what is the significance of static storage class specifier?
How does struct work in c?
Is it possible to have a function as a parameter in another function?
Explain how do you convert strings to numbers in c?
How do I use strcmp?