Monday, 7 January 2013

Write a C code which takes two inputs X and Y, and displays “True” If number X is a multiple of number Y, and displays “False” otherwise


#include<stdio.h>

void main ()

{

  int x,y;

  printf("enter value of X:");
  scanf("%d",&x);
  printf("enter value of Y:");
  scanf("%d",&y);

 
 
  if(x%y==0)
  {printf("true");

  }

  else

  {printf("false");
 
  }
 

}

No comments:

Post a Comment