Monday 8 April 2013

C++ PROGRAM TO DISPLAY A TABLE OF VALUES FOR A FUNCTION y=e^x WHERE X VARIES FROM 0 TO 1 IN STEPS OF 0.1


#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
double x;
clrscr();
cout<<"-------------------------------------------------------------\n";
cout<<"X\t\t\tY\n";
cout<<"-------------------------------------------------------------\n";
for(x=0;x<=1;x+=0.1)
{
double y=exp(x);
cout<<x<<"\t\t\t"<<y<<endl;
}
getch();
}

No comments:

Post a Comment