c program to manipulate x=1+3+5+...+n using recursion
Answer Posted / naresh m
main()
{
int sum=0,i;
int p,n;
printf("enter value for n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
p=(i*2-1);
sum=sum+p;
}
printf("sum is %d",sum);
}
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
What are the loops in c?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
How to declare pointer variables?
How will you declare an array of three function pointers where each function receives two ints and returns a float?
Why static is used in c?
Write a program to print “hello world” without using semicolon?
hi, which software companys will take,if d candidate's % is jst 55%?
Which is an example of a structural homology?
What is the method to save data in stack data structure type?
What is meant by high-order and low-order bytes?
can we have joblib in a proc ?
What is oops c?
Explain the meaning of keyword 'extern' in a function declaration.
When should the volatile modifier be used?