234
cout <<“\n b=”; cin>>b;
cout <<“\n c=”; cin>>c;
if (a>b)
if (a>c) max=a; else max=c;
else
if (b>c) then max=b; else max=c;
cout <<“\n” <
Misol tariqasida kiritilgan ball va maksimal ball asosida baho aniqlanadi:
7-listing.
Output:
#include
void main( )
{ float ball,max_ball,baho,d;
cout<< “\n ball=”; cin>>ball;
cout<<“\n max_ball=”; cin>>max_ball;
d=ball/max_ball;
if (d>0.85) baho=5; else
if (d>75) baho=4; else
if (d>0.55) then baho=3; else baho=2;
cout<<“\n” << baho; }
baho