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 the code to display color fonts in the output?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
Explain what are compound statements?
Name the language in which the compiler of "c" in written?
Which of the following about automatic variables within a function is correct ? a.its type must be declared before using the variable b.they are local c.they are not initialised to zero d.they are global.
program for reversing a selected line word by word when multiple lines are given without using strrev
In C language what is a 'dangling pointer'?
What are c header files?
What's a "sequence point"?
write a program to find out number of on bits in a number?
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
who will call your main function in c under linux?