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

Answers were Sorted based on User's Feedback



c program to manipulate x=1+3+5+...+n using recursion..

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

c program to manipulate x=1+3+5+...+n using recursion..

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

More C Interview Questions

write a c program to remove all the duplicate characters in a string and replace with single character? ex:-input- AAABBBCCC output- ABC

2 Answers   HCL,


How are 16- and 32-bit numbers stored?

0 Answers  


wat is the output int main() { char s1[]="Hello"; char s2[]="Hello"; if(s1==s2) printf("Same"); else printf("Diff"); }

3 Answers  


What is wild pointer in c?

0 Answers  


why TCS selected more student in the software field from all institution.

5 Answers   TCS,


write a program to find a given no. is divisible by 3 or not without using any arthimetic operators?

3 Answers   Broadcom, TCS,


where does malloc() function get the memory?

1 Answers  


What are the advantages of using new operator as compared to the function malloc ()?

0 Answers   NIIT,


triangle number finding program...

1 Answers   HCL,


Explain about the functions strcat() and strcmp()?

0 Answers  


write a program to convert a expression in polish notation (postfix) to inline (normal)

0 Answers   Siemens,


Describe the difference between = and == symbols in c programming?

0 Answers  


Categories