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 |
What is 02d in c?
Tell me is null always defined as 0(zero)?
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
What does printf does?
Explain how do you search data in a data file using random access method?
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
Differentiate between static and dynamic modeling.
what does keyword ‘extern’ mean in a function declaration?
Write a program of advanced Fibonacci series.
Write a function in c to find the area of a triangle whose length of three sides is given.
What are the advantages of c preprocessor?
write a program to print infinte number