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 is C language ?

1965


How do I use strcmp?

1073


Explain function?

1086


What is the role of this pointer?

1070


Explain 'bit masking'?

1086


write a c program to find the sum of five entered numbers using an array named number

2137


What are the advantages of external class?

1061


Why c is called a mid level programming language?

1068


What is the meaning of typedef struct in c?

1065


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2738


What 'lex' does?

1177


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

2348


What do you mean by command line argument?

1169


Was 2000 a leap year?

1049


What is the full form of getch?

1272