April 13, 2025 03:18:55 AM
Latest Post

10:29 PM Copyright Free Audio Tracks

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;
  }


Output:

                          
 
Screenshot:01
 
Screenshot:02
21 Jun 2014
Show Comments: OR

0 comments:

Post a Comment

আপনার একটি মন্তব্য একজন লেখক কে ভালো কিছু লিখার অনুপ্ররেনা যোগাই তাই প্রতিটি পোস্ট পড়ার পর নিজের মতামত জানাতে ভুলবেন না । তবে এমন কোন মন্তব্য করবেন না যাতে লেখকের মনে আঘাত করে !!

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

 
Top

Contact With Me