Q:

Write a C Program to Print integer value in Decimal, Octal, Hexadecimal

0

Write a C Program to Print integer value in Decimal, Octal, Hexadecimal using printf. Here’s simple Program to Print integer value in Decimal, Octal, Hexadecimal using printf in C Programming Language.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Below is the source code for C Program to Print integer value in Decimal, Octal, Hexadecimal using printf which is successfully compiled and run on Windows System to produce desired output as shown below :

SOURCE CODE : :

/*  C Program to Print integer value in Decimal, Octal, Hexadecimal using printf  */

#include <stdio.h>

int main()
{
    int value=3412;

    printf("Decimal value is: %d\n",value);
    printf("\nOctal value is: %o\n",value);
    printf("\nHexadecimal value is (Alphabet in small letters): %x\n",value);
    printf("\nHexadecimal value is (Alphabet in capital letters): %X\n",value);

    return 0;
}

 

OUTPUT : :

Decimal value is: 3412

Octal value is: 6524

Hexadecimal value is (Alphabet in small letters): d54

Hexadecimal value is (Alphabet in capital letters): D54

Above is the source code for C program to print ASCII value of entered character which is successfully compiled and run on Windows System.The Output of the program is shown above .

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C Basic Solved Programs – C Programming

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a C program to find size of variables using ... >>
<< Write a C program to find power of a number ( x^n ...