Question:
Consider the room numbers of AIUB campus 4 - 423, 432, 441, 234, 534, 132. Here first digit represents campus number, second digit represents floor number and third digit represents room number in that floor. Write a program that will take a three digit number (like 423) and output the campus, floor & room number according to the input..
Solve:
#include<stdio.h> int main() { char ch[4]; printf("Please input campus code:"); scanf("%s",ch); printf("Campus: %c\n",ch[0]); printf("Floor: %c\n",ch[1]); printf("Room: %c\n",ch[2]); return 0; }