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 / 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


Please Help Members By Posting Answers For Below Questions

What is modeling?

1063


What is the difference between null pointer and wild pointer?

1204


What is the purpose of type declarations?

1122


Which built-in library function can be used to match a patter from the string?

1307


What is the maximum no. of arguments that can be given in a command line in C.?

1158


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

1244


What is the difference between constant pointer and constant variable?

1235


1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

3731


How can I read data from data files with particular formats?

1051


What are volatile variables in c?

958


what is the significance of static storage class specifier?

2267


How does struct work in c?

1097


Is it possible to have a function as a parameter in another function?

1086


Explain how do you convert strings to numbers in c?

1084


How do I use strcmp?

1086