Monday 20, February 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
 
Compare two strings using c
This program will input two strings and compare them. It will show both strings are equal, first string is greater than second or first string is less than second....more »
Category : C Programs Hits : 1401
   
Find Factorials using Recursion in c
This c program will use recursive function and calculate the factorial of given number....more »
Category : C Programs Hits : 1554
   
concatenate two strings c language
Here is an example code to concatenate two strings using clanguage....more »
Category : C Programs Hits : 3123
   
arrays and pointers in c
An example code for arrays and pointers in c language....more »
Category : C Programs Hits : 1743
   
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 : 2872
   
   
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 HOW TO GENERATE MASSIVE AMOUNTS OF TRAFFIC ON A SHOESTRING BUDGET Ebook HOW TO GENERATE MASSIVE AMOUNTS OF TRAFFIC ON A SHOESTRING BUDGET
   
Download Special Report  Ebook Special Report
   
Download Algorithms for Programmers  Ebook Algorithms for Programmers
   
Download Online Freelancing Success Ebook Online Freelancing Success
   
Download Step By Step Guide To Creating Your Own RSS Feed  Ebook Step By Step Guide To Creating Your Own RSS Feed
   
     
Studiesinn.com 2017 All Rights Reserved.
 
Website Designed & Developed by TechXprtz