Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 605d080

Browse files
Add files via upload
1 parent 9a59e8c commit 605d080

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

‎Converting Octal to Decimal number.c‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* C Program to Convert Octal to Decimal number */
2+
#include<stdio.h>
3+
#include<math.h>
4+
5+
int main()
6+
{
7+
long int octal,decimal=0;
8+
int i=0;
9+
10+
printf("Enter any octal number: ");
11+
scanf("%ld",&octal);
12+
13+
while(octal!=0)
14+
{
15+
decimal=decimal+(octal%10)*pow(8,i++);
16+
octal=octal/10;
17+
}
18+
printf("The Decimal number is: %ld\n",decimal);
19+
return 0;
20+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /