Describe for loop and write a c program to sum the series
X + x2/2! + x3 /3! + …….. up to fifteen terms.
Answer Posted / 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 |
Post New Answer View All Answers
Can you please explain the difference between malloc() and calloc() function?
How can I read and write comma-delimited text?
How can I prevent another program from modifying part of a file that I am modifying?
What is the most efficient way to count the number of bits which are set in an integer?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
Write a program to print ASCII code for a given digit.
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
What is register variable in c language?
What are the types of c language?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
What is the use of #include in c?
which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +
swap 2 numbers without using third variable?
What are the main characteristics of c language describe the structure of ac program?