Archive for December 2011
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
long int n,i,k=1,rem=0,bin=0;
clrscr();
printf(“Enter any bianary value : “);
scanf(“%ld”,&n);
for(i=1;n>0;i++)
{
rem = n % 10;
bin = bin + (rem * k);
k = k * 2;
n = n / 10;
}
printf(“\n Your decimal no is = %ld”,bin);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int n,a,r,b;
printf(“enter the no.::”);
scanf(“%d”,&n);
while(n>0)
{
a=n%10;
r=+a;
n= int (n/10);
printf(“%d”,r);
}
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
clrcsr();
int a,b,c,d;
scanf(“%d”,&a);
scanf(“%d”,&b);
scanf(“%d”,&c);
d=a;
a=b;
b=c;
c=d;
printf(“%d\n”,a);
printf(“%d\n”,b);
printf(“%d\n”,c);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a, b,c;
printf(“enter the 1 value”);
scanf(“%d”,&a);
printf(“enter the 2 value”);
scanf(“%d”,&b);
c=a+b;
printf(“sum is:%d”,c);
getch();
}
27
Dechow to find maximum number from three value???
0 Comments | Posted by ravinakalkani in C language
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c;
printf(“enter 1 value:”);
scanf(“%d”,&a);
printf(“enter 2 value:”);
scanf(“%d”,&b);
printf(“enter 3 value:”);
scanf(“%d”,&c);
if(a==b && b==c)
{
printf(“a,b,c are equal”);
}
else if(a==b)
if( a>c)
{
printf(“a=b is max”);
}
else
{
printf(“a=b and c is max”);
}
else if(b==c)
if(b>a)
{
printf(“b=c is max”);
}
else
{
printf(“b=c and a is max”);
}
else if(c==a)
if(c>b)
{
printf(“c=a is max”);
}
else
{
printf(“c=a and b is max”);
}
else if(a>b && a>c)
{
printf(“a is max”);
}
else if(b>a && b>c)
{
printf(“b is max”);
}
else if(c>a && c>b)
{
printf(“c is max”);
}
getch();
}
![[del.icio.us]](http://www.itshala.com/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.itshala.com/wp-content/plugins/bookmarkify/digg.png)
![[dzone]](http://www.itshala.com/wp-content/plugins/bookmarkify/dzone.png)
![[Facebook]](http://www.itshala.com/wp-content/plugins/bookmarkify/facebook.png)
![[Google]](http://www.itshala.com/wp-content/plugins/bookmarkify/google.png)
![[LinkedIn]](http://www.itshala.com/wp-content/plugins/bookmarkify/linkedin.png)
![[Twitter]](http://www.itshala.com/wp-content/plugins/bookmarkify/twitter.png)
![[Windows Live]](http://www.itshala.com/wp-content/plugins/bookmarkify/windowslive.png)
![[Yahoo!]](http://www.itshala.com/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://www.itshala.com/wp-content/plugins/bookmarkify/email.png)
