Tuesday 23, May 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
 
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 : 5416
   
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 : 2948
   
Printing triangle of numbers using c
Here is the source code for printing triangle of numbers using c language. In this example user will input a number, it will start from 1 and will go to the give number.
1
2 3
4 5 6
7 8 9 10...more »
Category : C Programs Hits : 2687
   
Find a substring in another string using c
This program will input a string and a substring and than check whether the substring is present is string or not....more »
Category : C Programs Hits : 3305
   
Check the given year is leap or not using c
This program will input a year and check whether it is a leap year or not....more »
Category : C Programs Hits : 3077
   
   
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 Intro to Ebay and Sourcing Guide Ebook Intro to Ebay and Sourcing Guide
   
Download Structure and Interpretation of Computer Programs  Ebook Structure and Interpretation of Computer Programs
   
Download Explode Your Opt In List Ebook Explode Your Opt In List
   
Download Secrets of Affiliate Marketing Ebook Secrets of Affiliate Marketing
   
Download An Introduction to Computer Security: The NIST Handbook  Ebook An Introduction to Computer Security: The NIST Handbook
   
     
Studiesinn.com 2017 All Rights Reserved.
 
Website Designed & Developed by TechXprtz