C Program to convert a given decimal number into its binary equivalent

C Program to convert a given decimal number into its binary equivalent. In this program we convert the given decimal based number system(0, 1, 2, 3, —–,9) to Binary number system(0 and 1). Read more about C Programming Language .

/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact [email protected]
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* This program was originally published at
* http://www.c-program-example.com/2011/09/you-can-use-all-programs-on-www_8419.html
* Happy Coding
***********************************************************/
/* Write a program to convert a given decimal numbers into its binary equivalent . */
#include<stdio.h>
int main()
{
int num,i=0,binary=0,num1, biny[30],counter=0;
printf("Enter the Decimal number:\n");
scanf("%d",&num);
num1=num;
do
{
binary=num%2;
biny[i]=binary;
num=num/2;
i++;
counter++;
} while(num>0);
printf("\nThe given decimal %d number binary equalant is :\n",num1);
counter--;
while(counter>=0){
printf("%d" ,biny[counter]);
counter--;
}
return 0;
}

Read more Similar C Programs
Array In C

Number System

Simple C Programs

You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can Follow @c_program

You can discuss these programs on our Facebook Page. Start a discussion right now,

Share this program with your Facebook friends now! by liking it

Like to get updates right inside your feed reader? Grab our feed!

(c) www.c-program-example.com

C Program To Find The Largest Of 3 Numbers

C Program To Find The Biggest(Largest) Of 3 Numbers. In this program, We find the biggest of three number using simple else-if ladder. Read more about C Programming Language .
 
/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact [email protected]
* To find more C programs, do visit www.c-program-example.com
* and browse!
* This program was originally posted at
* http://www.c-program-example.com/2011/09/you-can-use-all-programs-on-www_30.html
* Happy Coding
***********************************************************/
/* C Program To Find The Biggest(Largest) Of 3 Numbers */
#include<stdio.h>
int main() {
int a, b, c;
printf("Enter the value for a:\n");
scanf("%d", &a);
printf("Enter the value for b:\n");
scanf("%d", &b);
printf("Enter the value for c:\n");
scanf("%d", &c);
if ((a > b) && (a > c)) {
printf("\n The big one is a= %d", a);
} else if (b > c) {
printf("\n The big one is b= %d", b);
} else {
printf("\n The big one is c= %d", c);
}
return 0;
}
view raw biggestof3.c hosted with ❤ by GitHub

Read more Similar C Programs
Array In C
Number System

Simple C Programs

You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can Follow @c_program

You can discuss these programs on our Facebook Page. Start a discussion right now,  our page!

Share this program with your Facebook friends now! by liking it

Like to get updates right inside your feed reader? Grab our feed!
(c) www.c-program-example.com

C Program to find the array c such that c[i] = a[i ]+ b[n-1-i]

Example programs to solve the problems of Arrays in C,
a and b are two integers arrays each with n elements. C program to find the array c such that c[i]=a[i]+b[n-1-i]. Read more about C Programming Language .

/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact [email protected]
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/
/*a and b are two integers arrays each with n elements.
Write a program to find the array c such that c[i]=a[i]+b[n-1-i] */
#include<stdio.h>
int main() {
int a[20], b[20], c[30], i, n;
printf("Enter the number of elements to the array:\n");
scanf("%d", &n);
printf("\nEnter the %d elements to the array A:\n", n);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
printf("\nEnter the %d elements to the array B:\n", n);
for (i = 0; i < n; i++) {
scanf("%d", &b[i]);
}
for (i = 0; i < n; i++) {
c[i] = a[i] + b[n - 1 - i];
}
printf("\nC array elements are:\n");
for (i = 0; i < n; i++) {
printf("\n");
printf("%d", c[i]);
}
return 0;
}
view raw find_array.c hosted with ❤ by GitHub

Read more Similar C Programs
Array In C

Simple C Programs

You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can Follow @c_program

You can discuss these programs on our Facebook Page. Start a discussion right now,

 our page!

Share this program with your Facebook friends now! by liking it

 (you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!

(c) www.c-program-example.com

C Program to classify the triangle as equilateral, isosceles and scalene

C Program to classify the triangle as equilateral, isosceles and scalene.
Equilateral triangle means all three side and angles are equal(i.e. 60 degree).
Isosceles triangle means any two side and angles are equal.
Scalene triangle means , any sides and any angles are not equal.
Read more about C Programming Language .

Read more Similar C Programs
Learn C Programming

Simple C Programs

To get regular updates on new C programs, you can Follow @c_program

You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!

Share this program with your Facebook friends now! by liking it

(you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!

(c) www.c-program-example.com

C Program to compute the area of an isosceles triangle

C Program to compute the area of an isosceles triangle. Isosceles Triangle is triangle, in which any two sides and angles are equal. Here, We check the given triangle is Isosceles or not also and print the suitable messages. Read more about C Programming Language .
Read more Similar C Programs
Learn C Programming

Simple C Programs

You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can Follow @c_program

You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!

Share this program with your Facebook friends now! by liking it

(you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!

–>

(c) www.c-program-example.com

Print “Hello World” Without Using Semicolon

How to Write a “Hello World” C program without using semicolon?
Asked in various interviews…
Read more about C Programming Language .

Read more Similar C Programs
C Interview Questions

Number Theory 
C Strings

You can easily select the code by double clicking on the code area above.
To get regular updates on new C programs, you can Follow @c_program
You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!
Share this program with your Facebook friends now! by liking it

(you can send this program to your friend using this button)
Like to get updates right inside your feed reader? Grab our feed!

(c) www.c-program-example.com