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


Write a C program that computes the value ex by using the
formula
ex =1+x/1!+x2/2!+x3+3!+………….



Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+……â€..

Answer / dally

#include<stdio.h>
int main()
{
char c = 'X';
int i,n,sum = 0;
printf("Enter values for n\n");
scanf("%d\n",&n);
for(i=0;i<n;i++)
{
sum = sum+power(c,i)/fact(i);
}
fact(int i)
{
int p=1 ,fact;
if(p<=i)
{
fact = p*fact(p++);
}
return fact;
}

Is This Answer Correct ?    24 Yes 43 No

Post New Answer

More C Interview Questions

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

0 Answers  


What is spaghetti programming?

0 Answers  


Why doesn't the code "a[i] = i++;" work?

4 Answers  


#include<stdio.h> int main(){ int a[]={1,2,3,5,1}; int *ptr=a+4; int y=ptr-a; printf("%d",y); }

3 Answers   Zoho,


When is a “switch” statement preferable over an “if” statement?

0 Answers  


What is difference between array and pointer in c?

0 Answers  


what is the size of an integer variable?

4 Answers  


What are header files in c?

0 Answers  


write a program to display & create a rational number

1 Answers   HCL, TCS,


What does & mean in scanf?

0 Answers  


Why do we use null pointer?

0 Answers  


. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The value of b[-1] is (A) 1 (B) 3 (C) -6 (D) none

9 Answers   Oracle,


Categories