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
Write a program on swapping (100, 50)
What is %s and %d in c?
What are the types of operators in c?
What is #line in c?
Why & is used in scanf in c?
What does c value mean?
What is difference between union All statement and Union?
Differentiate between a for loop and a while loop? What are it uses?
Can you apply link and association interchangeably?
difference between native and cross compilers
How can I change their mode to binary?
Who is the main contributor in designing the c language after dennis ritchie?
What is a ternary operator in c?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
write a programming in c to find the sum of all elements in an array through function.