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 the “if” function be used in comparing strings?
Explain what are the standard predefined macros?
What is mean by data types in c?
What is nested structure?
Which is best book for data structures in c?
What are the restrictions of a modulus operator?
What is output redirection?
What is c system32 taskhostw exe?
How can I remove the leading spaces from a string?
Can you assign a different address to an array tag?
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
Write programs for String Reversal & Palindrome check
What is keyword with example?
What are the advantage of c language?
What are keywords in c with examples?