Tuesday 28, March 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
 
pointer and there uses in c
Example code for pointer and there uses in c language....more »
Category : C Programs Hits : 1784
   
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 : 5378
   
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 : 2653
   
C Program to Reverse an array
Here is a program which will take input from user in array and will reverse it using c language....more »
Category : C Programs Hits : 1634
   
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 : 3003
   
   
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 Introduction to Computer Science using Java Ebook Introduction to Computer Science using Java
   
Download tears of the mystic rose Ebook tears of the mystic rose
   
Download Restore Your Computer in a Few Minutes Ebook Restore Your Computer in a Few Minutes
   
Download Make Your Price Sell  The Master Course  Ebook Make Your Price Sell The Master Course
   
Download How to Make 100 Daily Online  Ebook How to Make 100 Daily Online
   
     
Studiesinn.com 2017 All Rights Reserved.
 
Website Designed & Developed by TechXprtz