Graph of e^x

Problem Statement
Write a c program to make graph of ex form 0 to 2
on the terminal

#include<stdio.h>
#include<math.h>
#define e 2.7
int main()
{
  float x,temp,i,y;
  x=2.0;
  while(x>0)
    {
      temp=log(x);
      for(i=0;i<temp;)
{
 printf("*");
          i=i+.1;
}
      printf("\n");
      x=x-.1;
    }
  scanf("%d",&y);
  return 0;
}

No comments:

Post a Comment