Program Operator Penambahan & Pengurangan |
/*filename = Program Operator Penambahan & Pengurangan */
/*Oleh : fk_seven */
/*Date : 14 Agustus 2011 */
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
main()
{
//Deklarasi variabel dan konstanta
atas :
clrscr();
int a, b, c, d;
char lagi;
//Input
cout<<"Program Operator Penambahan & Pengurangan"<<endl;
cout<<"-----------------------------------------"<<endl<<endl;
cout<<"Inputkan Nilai A ; "; cin>>a;
cout<<"Inputkan Nilai B ; "; cin>>b;
cout<<"Inputkan Nilai C ; "; cin>>c;
cout<<"Inputkan Nilai D ; "; cin>>d;
cout<<endl<<endl;
//Output
cout<<"Nilai A : " <<a<<endl;
cout<<"Nilai A++ : " <<a++<<endl;
cout<<"Nilai A Akhir : " <<a<<endl<<endl;
cout<<"Nilai B : " <<b<<endl;
cout<<"Nilai B++ : " <<++b<<endl;
cout<<"Nilai B Akhir : " <<b<<endl<<endl;
cout<<"Nilai C : " <<c<<endl;
cout<<"Nilai C-- : " <<c--<<endl;
cout<<"Nilai C Akhir : " <<c<<endl<<endl;
cout<<"Nilai D : " <<d<<endl;
cout<<"Nilai --D : " <<--d<<endl;
cout<<"Nilai D Akhir : " <<d<<endl<<endl<<endl;
//Finishing
cout<<"Inputkan Data Lagi [Y/y/T/t] : "; cin>>lagi;
if(lagi=='Y' || lagi=='y')
goto atas ;
else if(lagi=='T' || lagi=='t')
exit(0);
else
cout<<" =>Input SALAH . . .";
getch();
}
0 komentar:
Posting Komentar