Hello again all knowing and all seeing cprogramming peoples. I have a quick question. I would like to display or print out on the screen a fraction. I would be most happy if it looked like this:
3/4
I figure it shouldnt be to hard but im an 'intro' programmer with very little skills. Below is the code i wrote that got around the problem but I was wondering if I could achieve the above display in c++. If it cannot then just call me a pirate and i will scurvy outta here but if im wrong, like i usally am with these things, i would appreciate any help in the right direction. Thanks ahead
My idea that has acheived notta:Code://get inputs for first fraction
cout<<"enter in the first numerator:";
cin>>num1;
cout<<"Enter in the first denominator:";
cin>>den1;
cout<<"You entered in "<< num1 <<"/"<< den1 <<" as your first fraction"<<endl;
Logically it doesnt work cause 0/0 is what comes out. but im almost certain this is waaaaay to long of a post about such a simple task. My research has netted my a whole lotta talk about class and public which is two things i tend to vere away fromCode://get inputs for first fraction
cout<<"Enter in the first fraction:"<<num1<<"/"<<den2<<endl;
:p