Archive for the ‘Lab 9’ Category

#include<stdio.h>
int main()
{
	int a,b;
	scanf("%d%d",&a,&b);
	if(a==b)
	{
		printf("Number is Equal");
	}
	else
		printf("0");
	return 0;
}
Advertisements
#include <stdio.h>
int main()
{
   int n, reverse = 0,num;
   printf("Enter a number\n");
   scanf("%d",&n);
	num=n;
   while (n != 0)
   {
      reverse = reverse * 10;
      reverse = reverse + n%10;
      n = n/10;
   }
if(reverse== num)
		{

    printf("1");
	}
    else{
    printf("\n The Number is not a Palindrome\n ");
}
   return 0;
}
#include <stdio.h>
	int main()
	{
	   int number, sum = 0, n, remainder;
	   printf("Enter a number\n");     
	   scanf("%d",&number);
	   n = number;
	  
	   while( n != 0 )
	   {
	      remainder = n%10;
	      sum = sum + remainder*remainder*remainder;
	      n = n/10;
	   }
	  
	   if ( number == sum )
	      printf("1");
	   else
	      printf("Number is not an armstrong number.");        
	  
	   return 0;
	}
#include<stdio.h>
int main()
{
int x;
char y=0;
scanf("%c",&y);
x=y;
printf("%d",x);
	return 0;
}

#include <stdio.h>
int main(){
  float r, a;
  printf("Radius: ");
  scanf("%f", &r);
  a = 3.14 * r * r;
  printf("%f\n", a);
  return 0;
}

#include<stdio.h>
int main()
{
	printf("/*/JUET provides you a way to achieve success in life/*/");
	return 0;
}
#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,c,d,e,f,ch;
printf("Enter 1st no\n");
scanf("%d",&a);
printf("Enter 2nd no\n");
scanf("%d",&b);
printf("Enter choice 1.add 2.sub 3.mul 4.div\n");
scanf("%d",&ch);
switch(ch)
	{
case 1:
c=a+b;
printf("%d",c);
break;
case 2:
d=a-b;
printf("%d",d);
break;
case 3:
e=a*b;
printf("%d",e);
break;
case 4:
f=a/b;
printf("%d",f);
break;
}
return 0;
}