What's Here?
- Members: 149,630
- Replies: 506,753
- Topics: 79,851
- Snippets: 2,666
- Tutorials: 706
- Total Online: 2,065
- Members: 80
- Guests: 1,985
|
Displays an integer from decimal number system to hexadecimal and octal number system.
|
Submitted By: PennyBoki
|
|
Rating:
|
|
Views: 4,436 |
Language: C
|
|
Last Modified: July 26, 2007 |
|
Instructions: Just RUN it and enter an integer. |
Snippet
//PennyBoki @ </dream.in.code>
#include <stdio.h>
#include <stdlib.h>
int main()
{
int number; // declaring an integer variable
scanf("%d",&number); //reads the number
printf("In decimal number system => %d\n",number ); // displays the number in decimal number system
printf("In hexadecimal number system => %x\n",number ); // displays the number in hexadecimal number system
printf("In octal number system => %o\n",number ); // displays the number in octal number system
system("pause");
return 0;
}
Copy & Paste
|
|
|
Be Social
Programming
Web Development
Reference Sheets
Bye Bye Ads
Monthly Drawing
Top Contributors
Top 10 Kudos This Month
|