Skip to content

Instantly share code, notes, and snippets.

@rajeevs1992
Last active December 11, 2015 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajeevs1992/4595171 to your computer and use it in GitHub Desktop.
Save rajeevs1992/4595171 to your computer and use it in GitHub Desktop.
#include<iostream>
#include<fstream>
#include<stdio.h>
using namespace std;
int main()
{
char exp[50],x[10];
cout<<"\nEnter the function ";
gets(exp);
cout<<"\nEnter the value of x ";
gets(x);
ofstream o;
o.open("temp.cpp");
o<<"\n#include<stdio.h>\n#include<iostream>\nusing namespace std;\n int main()\n{";
o<<"\nfloat res,x="<<x<<";";
o<<"\nres="<<exp<<";";
o<<"\ncout<<res<<endl;\n}";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment