Write your question here.
hiiii everyone! so im making this program which calculates out the taylor series for e and i was able to do it however it went up to 2.71828 then stopped. i wanted the program to print out a longer decimal! so i tried to use double (all variables were originally float) to add length but when i did the program didnt calculate the number right! please help.
float main() Violates standard, should not compile. If your compiler allows that, I suggest to change it immideatly.
also printf_s is non-standard and I have no Idea how it is behave. If it is like normal printf(), you probably need to increase precision. Look there to see format string specifiers: http://en.cppreference.com/w/cpp/io/c/fprintf
example how it will look using C++ streams:
1 2 3
std::cout << setprecision(15) << e << std::endl;
well i always used float main cuz i thought int main would return an integer but i recently found out i was wrong. anyway im using microsoft visual studio and it always told me to use printf/scanf as printf_s/scanf_s.
it always told me to use printf/scanf as printf_s/scanf_s. Nobody could compile your code aside from those using visual studio.
And which version of VS do you use? If something older than 2012, upgrade. Also look documentation and turn on most warnings aside from "using standard function instead of Microsoft ones" aka "Warning: it looks like you might write portable code"
I have already posted link to printf format string description. Read it.
Also in C++ it is <cstdio> instead of outdated and unsupported <stdio.h>
and <cmath>. Also conio.h is extremely outdated and do not advised to use in any operation system newer than DOS (for which it was created).