Forum Index



Reply to topic
fstream,combinatii cu operatiii intre 2 numere
Radbug
SUPREME DRINKER
SUPREME DRINKER
Radbug
Joined: 16 Oct 2009
Posts: 17
Reply with quote
Code:
#include <iostream.h>
#include <fstream.h>
ifstream fin("suma.in");
ofstream fout("suma.out");
float a,b,s,d,p,d2,i,i2;
int main()
{
fin>>a;
fin>>b;
s=a+b;
p=a*b;
d=a-b;
d2=b-a;
i=a/b;
i2=b/a;
fout<<a<<"+"<<b<<"="<<s<<'\n';
fout<<a<<"*"<<b<<"="<<p<<'\n';
fout<<a<<"-"<<b<<"="<<d<<'\n';
fout<<b<<"-"<<a<<"="<<d2<<'\n';
fout<<a<<"/"<<b<<"="<<i<<'\n';
fout<<b<<"/"<<a<<"="<<i2<<'\n';
fin.close();
fout.close();
return 0;
}
View user's profileSend private message
fstream,combinatii cu operatiii intre 2 numere
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT + 2 Hours  
Page 1 of 1  

  
  
 Reply to topic