Tuesday 2 July 2013

source code: class room Number Analysis [ easy and simple version and user friendly likewise always]

#include<iostream>
using namespace std;

char rn[4];

void room_number()
{
cout <<"tell me your room number: ";
for(int x= 0; x<4; x++)
{
cin>> rn[x];
}
cout <<"got it (Y)\n\n";

if(rn[1] == '0')
{
cout <<"your room is in campus number: " <<rn[0];
cout <<"\nroom number: " <<rn[3] <<"\nat floor: " <<rn[2] <<endl;
}

else if(rn[0] == '0')
{
cout <<"your room is in campus number: " <<rn[1];
cout <<"\nroom number: " <<rn[3] <<"\nat floor: " <<rn[2] <<endl;
}

else
cout <<"aint working";
}

int main()
{
room_number();
cout <<"\n\n\nthank you :)\n\n\n";
}

No comments:

Post a Comment