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 types of structure?

1068


What are actual arguments?

1048


what are enumerations in C

1110


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

1050


What is operator precedence?

1152


What is uint8 in c?

1056


Why c is called object oriented language?

1012


How many levels of pointers have?

991


Why isnt any of this standardized in c?

1023


What is array of pointers to string?

1003


What is fflush() function?

1082


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

3918


What is spaghetti programming?

1074


What is pass by value in c?

1009


Explain how do you determine a file’s attributes?

1001