BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Bachelor of Science in Information Technology > BsIT 1st semester > Object Oriented Programming


Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1  
Old 08-05-2011, 11:12 PM
JuNaiDiQbaL's Avatar
Never Give Up

 
Join Date: Jan 2011
Location: SahiwaL
Age: 30
Posts: 26
Program / Discipline: BSIT
Class Roll Number: 10-26
JuNaiDiQbaL has a spectacular aura aboutJuNaiDiQbaL has a spectacular aura about
Default A Program to find a greater digit in a four digit number.

1- #include<iostream.h>
2- #include<conio.h>
3- void main()
4- {
5- int num, a, b, c, d, mod;
6- cout<<"Enter Four Digit Number\n";

7- cin>>num;

8- a=num/1000;

9- mod=num%1000;

10- b=mod/100;

11- mod=mod%100;

12- c=mod/10;

13- mod=mod%10;

14- d=mod;

15- if(a>b && a>c && a>d)
16 cout<<" The Digit "<<a<<"is Greater\n";
17- else if(b>a && b>c && b>d)
18- cout<<" The digit "<<b<<"is Greater\n";
19- else if(c>a && c>b && c>d)
20- cout<<"" The digit "<<c<<"is Greater\n";
21- else
22- cout<<"The Digit "<<d<<"is Greater\n";

23- getch();
24- }

OUTPUT
Enter Four Digit Number
4567
The digit 7 is Greater
Reply With Quote
Reply

Tags
digit, find, greater, number, program


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Program to find number in an array JuNaiDiQbaL Object Oriented Programming 0 06-05-2011 10:32 PM
Program to identify if an input is a symbol, digit or character bonfire Object Oriented Programming 0 09-03-2011 12:11 AM
Program to convert 2-digit octal number into binary number and print it bonfire Object Oriented Programming 0 09-03-2011 12:03 AM
Program to find the Minimum Number in an Array .BZU. Visual Programming 0 15-12-2009 10:57 PM
Program to find the Maximum Number in an Array (By Sheraz) .BZU. Visual Programming 0 15-12-2009 09:16 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 10:19 AM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.