Neeraj Mishra

A crazy computer and programming lover. He spend most of his time in programming, blogging and helping other programming geeks.

Convert Decimal to Binary in C

Here you will get program to convert decimal to binary in C. We can convert a decimal number into binary by repeatedly dividing it by 2 and storing the remainder somewhere. Now display the remainders in reverse order. Also Read: Convert Binary to Decimal in C Convert Decimal to Binary in C #include<stdio.h> int main() { …

Convert Decimal to Binary in C Read More »

C++ Program to Print Truth Table of XY+Z

Here you will get C++ program to print truth table of XY+Z. #include<iostream> using namespace std; int main() { int x,y,z; cout<<“X\tY\tZ\tXY+Z”; for(x=0;x<=1;++x) for(y=0;y<=1;++y) for(z=0;z<=1;++z) { if(x*y+z==2) cout<<“\n\n”<<x<<“\t”<<y<<“\t”<<z<<“\t1”; else cout<<“\n\n”<<x<<“\t”<<y<<“\t”<<z<<“\t”<<x*y+z; } return 0; }   Output X Y Z XY+Z 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 …

C++ Program to Print Truth Table of XY+Z Read More »

C++ Program to Add Two Numbers

Here you will get C++ program to add two numbers. The program will ask user to enter two numbers and then calculate their sum. #include<iostream> using namespace std; int main() { int x,y,sum; cout<<“Enter first no: “; cin>>x; cout<<“Enter second no: “; cin>>y; sum=x+y; cout<<“\nSum = “<<sum; return 0; } Output Enter first no: 4 …

C++ Program to Add Two Numbers Read More »

C program to find greatest number among three numbers

#include<stdio.h> #include<conio.h> void main() { int x,y,z,max; clrscr(); printf(“Enter The Three Numbers:”); scanf(“%d%d%d”,&x,&y,&z); max=x; if(y>max&&y>z) max=y; else if(z>max) max=z; printf(“nThe Greatest Number among %d %d %d is %d”,x,y,z,max); getch(); }