Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the loops in c?

999


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1281


The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

1102


How to declare pointer variables?

1248


How will you declare an array of three function pointers where each function receives two ints and returns a float?

1376


Why static is used in c?

1096


Write a program to print “hello world” without using semicolon?

1124


hi, which software companys will take,if d candidate's % is jst 55%?

2093


Which is an example of a structural homology?

1328


What is the method to save data in stack data structure type?

1091


What is meant by high-order and low-order bytes?

1051


can we have joblib in a proc ?

2310


What is oops c?

1255


Explain the meaning of keyword 'extern' in a function declaration.

1155


When should the volatile modifier be used?

1189