Search This Blog

Tuesday, April 21, 2015

C Program to interchange the value of two variables without using third variable

C Program to interchange the value of two variables without using third variable. C Programming. Interchanging Variables.

#include <stdio.h>
void main()
{
 int a,b;
 a=20, b=30;
 b=a+b;
 a=b-a;
 b=b-a;
 printf("a=%d  b=%d", a,b);
}

Tuesday, April 7, 2015

C Programming | C Programs | C Examples | C Program to find greatest of three numbers

C Programming | C Programs | C Examples | C Program to find greatest of three numbers

#include <stdio.h>
void main ()
{
 int a,b,c;
 printf( "Enter three numbers:");
 scanf("%d %d %d ", &a, &b,&c);
 if (a>b)
   {
     if (a>c)
       printf("%d is Big",a);
     else
       printf("%d is Big",c);
     }
 else
   {
     if (b>c)
       printf("%d is Big",b);
     else
       printf("%d is Big",c);

   }
}