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

Write a program on swapping (100, 50)

1063


What is %s and %d in c?

973


What are the types of operators in c?

1002


What is #line in c?

961


Why & is used in scanf in c?

1050


What does c value mean?

1115


What is difference between union All statement and Union?

1059


Differentiate between a for loop and a while loop? What are it uses?

1132


Can you apply link and association interchangeably?

1071


difference between native and cross compilers

2080


How can I change their mode to binary?

1051


Who is the main contributor in designing the c language after dennis ritchie?

953


What is a ternary operator in c?

1058


the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b

2614


write a programming in c to find the sum of all elements in an array through function.

2115