C Practical and Assignment Programs-e^x series expansion

preview_player
Показать описание
C Practical and Assignment Programs-e^x series expansion
In this video we will write a program to calculate e^x using the series expansion of e^x. Now this program is written in C programming language but will work in C++.Fell free to provide you suggestion.

We The Computer Guys
Shreyas Zagade
Aakash Thakur
Ananya Jain
Рекомендации по теме
Комментарии
Автор

I can't thank you enough my friend .... i'm studying in Russia and i hade this question in the class, the teacher tried to explain it to us but i did not understand the logic behind it nor the language (because i'm a forigner ), but now it is clear .... thank you so much again and keep going ❤

human
Автор

line no. 10 will be - for( i = 1 ; i < n ; i++ ) {
because if we do <= then we are iterating one more than what we want
Thanks me later :)

arnabdutta
Автор

Hi guys, here is included the algorithm for the factorial
#include<iostream>
using namespace std;
float entrada, fact=1, x=1, div=1;
float suma=1;
int main(){
cout<<"Digite el valor de la potencia x (para calcular e^x): "<<endl; cin>>entrada;
for(int i=1;i<=20;i++){
fact=fact*i;
x=x*entrada;
suma=suma+x/fact;
}
cout<<suma<<endl;

return 0;
}

erwinrojasarabia
Автор

But why did you write temp=(temp *power)/I ...like if I want to find e^2 ..in reality it is equal to 1+2/1+4/2+ 8/(3×2) +16/(4×3×2) and so on..but according to this code, it would be 1+2/1+4/2+ 8/3...I mean there's no factorial below..rather it would be temp= temp*(power/i).

Pi-zxxo
Автор

but in divide there is factorial of 3 or 4 or 5 but you are only taking 3 4 or 5 in denominator and adding in ans . i have not understood this part for exmple i=3, numerator will be x*x*x but in denominator i=3 so x^3/3 there is but actually it should be x^3/3! 3 and 3! both are diff thing

GauravKumar-tbcn
Автор

Thank you

Write a C++ program to solve the following series by using recursion
x^1 + x^3 - x^5 + x^7-x^9 ………± x^n

rinyuzury
Автор

Hey I have a problem where I have to estimate the sum of the series a(n) = (-1)^(n+1)/(2n-1) to show that the sum is approaching to pi/4. Can you help me out how to get started on this problem?

atulasyper
Автор

Just passed my lab test because of this! A hero 👑

dynamo-_-
Автор

OMG, THANK YOU SO MUCH.
MY PROGRAMMING TEACHER LET US THIS AS HOMEWORK, I SPENT LIKE A WEEK WITH PROBLEMS THANKS TO DON'T KNOW HOW TO SOLVE IT. BUT YOU HELPED ME SO MUCH.

fannipatata
Автор

but fictorial of 5! is 5*4*3*2*1.
but u just divided it by 2 and 3 and 4

muhammadsheharyar
Автор

Why did you make accuracy integer in this program. We could run for loop for (power+1) time instead of defining int acc. Can we?

ChaliyaGamer
Автор

Who are talking about factorial part plz hear the logic very carefully. He is doing like this 1, 1*2, 1*2*3, etc= 1!, 1!*2, 2!*3, etc.

arnabkoley
Автор

Thanks sir for this explanation, I tried this in Fortran and it's perfect

kachifavour
Автор

Why are we taking the power of x in float, why not in ok int?

kallaalekhya
Автор

How to write a program for same problem but using function for factorial?

shwetawarghat
Автор

Can we write int ans=1.0 instead of writing float ans=1 and for the temp variable also.

surajmishra
Автор

Why you used “acc=4”

Please tell me

santanusaha
Автор

I tried this program alone but didn't find any solution..I think I am not for programming 😔

keshabdas
Автор

Plz help to write this program in maple

lorrosingchohan
Автор

you are amazing man thanks a lot for all the help
 

jadhisham