Code: Select all
/* I am going to make a phone derectory
made by G-sparkZ*/
#include<iostream>
using namespace std;
#define D 077
#define M 071
#define E 072
int main ()
{
int num;
char x;
cout<<"DIALOG-D"<<endl<<"MOBITEL-M"<<endl<<"ETISALAT-E"<<endl;
cout<<"ENTER THE CODE OF YOUR CONECTION -"<<endl;
cin>>x;
if(x==D){
cin>>num;
cout<<"DIALOG NUMBER -"<<D<<num<<endl;
}
else if(x==M){
cin>>num;
cout<<"MOBITEL NUMBER -"<<M<<num<<endl;
}
else(x==E);{
cin>>num;
cout<<"ETISALAT NUMBER -"<<E<<num<<endl;
}
system("pause");
return 1;
}
077XXXXXXX
Help me on this.What is the error I have made.
I could make this in this way.I could assign some values for int D,M,E then I could make this.But I tried to test defining