C program for all number conversion.

I have created a C program for all number conversion, its a small application using C language. I have used printf’s various format specifiers to minimize the code and utilizing the available features of printf function.

These are some of format specifiers used in the code.
  • %d => for signed decimal integer.
  • %o => unsigned octal integer.
  • %X => unsigned hexadecimal integer.
The number conversions supported by this code are listed below.
  • Binary to Octal
  • Binary to Decimal
  • Binary to Hexadecimal
  • Octal to Binary
  • Octal to Decimal
  • Octal to Hexadecimal
  • Decimal to Binary
  • Decimal to Octal
  • Decimal to Hexadecimal
  • Hexadecimal to Binary
  • Hexadecimal to Octal
  • Hexadecimal to Decimal

C program for all number conversion
All Number Conversions using C

Pyramid using C with a new logic.

There are many ways of solving a programming problem , and every one has his own logic to solve a problem. Here I also implemented a new logic using C language’s printf() function.
printf() function is more than just writing output to the screen i.e. it returns the number of characters it writes on the output screen.

One functionality of printf() is as follows.

printf(“Hello”+1); = ello
printf(“ABCDE”+2); = CDE
It skips the first n characters if we are using printf(“message”+n);

Another functionality of printf method is :

If we write =>  int num = printf(“Hello”); . Then num will have value 5 (Hello has 5 letters).

Similarly if we write,

int num = printf(“2017”);. Then num will have value 4 (2017 has 4 characters).

Pyramid Using C
Pyramid Using C