Monday, 17 November 2014

C program to change octal to decimal.


C program to change octal to decimal.

#include<stdio.h>

int main(){
   
    long int octalNumber;

    printf("Enter any octal number: ");
    scanf("%o",&octalNumber);

    printf("Equivalent decimal number is: %d",octalNumber);

    return 0;
}

Sample output:


Enter any octal number: 17

Equivalent decimal number is: 15

No comments:

Post a Comment