Friday 23, June 2017
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    About Us    |    Contact Us

  Convert decimal number to binary number in c

This c language program will input an integer in decimal numbers system and convert it to binary numbers system. Decimal to Binary Conversion, Convert from decimal to binary using c language.
Cut & Paste Script
#include <stdio.h>
 
int main()
{
  int n, c, k;
 
  printf("Enter an number\n");
  scanf("%d", &n);
 
  printf("%d in binary numbers system is:\n", n);
 
  for (c = 31; c >= 0; c--)
  {
    k = n >> c;
 
    if (k & 1)
      printf("1");
    else
      printf("0");
  }
 
  printf("\n");
 
  return 0;
}
 
   
     RELATED SCRIPTS
 
C program to show memory address of array elements and access array elements using pointers
This program will visualize the memory address of each array element and will show you how to access array elements using pointer....more »
Category : C Programs Hits : 2967
   
pointer and there uses in c
Example code for pointer and there uses in c language....more »
Category : C Programs Hits : 1829
   
arrays and pointers in c
An example code for arrays and pointers in c language....more »
Category : C Programs Hits : 1806
   
Check number is prime or not using c

Here is a code example to check the number is prime or not a prime number. It will input number from user. If number is prime, it will print "Number is prime" on screen and if number is not prime it will print "Number is not prime".

...more »
Category : C Programs Hits : 5434
   
Bubble sort using c language
This program will sort an array using bubble sort in c language. c program for bubble sort, bubble sort in c, sorting an array using bubble sort in c language....more »
Category : C Programs Hits : 3324
   
   
SCRIPT CATEGORIES
 
  C Programs
C Programs scripts
  C++ Programs
C++ Programs scripts
  Java Programs
Java Programs scripts
  JavaScript Examples
JavaScript Examples scripts
  PHP Examples
PHP Examples scripts
  VBScript Examples
VBScript Examples scripts
 
 
 
POPULAR E-BOOKS
 
Download C++ In Action: Industrial Strength Programming Techniques  Ebook C++ In Action: Industrial Strength Programming Techniques
   
Download Neil's Guide to C++  Ebook Neil's Guide to C++
   
Download Income Plan Ebook Income Plan
   
Download Building Skills in Object-Oriented Design - Step-by-Step Construction of A Complete Application  Ebook Building Skills in Object-Oriented Design - Step-by-Step Construction of A Complete Application
   
Download Data Structures and Algorithms With Object-Oriented Design Patterns in Java  Ebook Data Structures and Algorithms With Object-Oriented Design Patterns in Java
   
     
Studiesinn.com 2017 All Rights Reserved.
 
Website Designed & Developed by TechXprtz