Describe for loop and write a c program to sum the series
X + x2/2! + x3 /3! + …….. up to fifteen terms.
Answers were Sorted based on User's Feedback
Answer / gouthami chintala
#include<stdio.h>
#include<conio.h>
void main()
{
int sum=0;
int x,i,j,c=1;
printf("enter a value for a x);
scanf("%d",&x);
for(i=1;i<=15;i++)
{
for(j=i;j<=1;j--)
{
c=c*i;
}
sum=sum+(x/c);
}
printf("the value of x+x/2!+x/3!----- for the given x value
is");
printf("%d",sum);
}
| Is This Answer Correct ? | 24 Yes | 15 No |
Answer / sai
#include<math.h>
void main()
{
int i,sum=0,x;
clrscr();
printf("enter x value");
scanf("%d",&x);
for(i=1;i<=15;i++)
sum=sum+((x*i)/fact(i));
printf("sum of x+x2/2!.......x15/15!=%d",sum);
getch();
}
| Is This Answer Correct ? | 10 Yes | 13 No |
Why is C called a middle-level language?
what is ans for this scanf(%%d",c);
What is a Genralised LInked List?? Please give a detailed explation of it..
Tell me a C program to display the following Output? 1 1 1 1 1 2 2 2 2 3 3 3 4 4 5
how to find that no is int or float?
main() { int a[10]; printf("%d",*a+1-*a+3); }
What does the function toupper() do?
f(x,y,z) { y = y+1; z = z+x; } main() { int a,b; a = 2 b = 2; f(a+b,a,a); print a; } what is the value of 'a' printed
How to set a variable in the environment list?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
What are different types of variables in c?
What is the Difference between Macro and ordinary definition?
3 Answers Bosch, Cognizant, College School Exams Tests, Motorola,