Saturday, August 18, 2018

TWOS MODS

  • Problem Description

    Bheem has two numbers, he wants to know the modulous value of those two numbers.
    Your task is to write a c Program to calculate the modulus of two given numbers.Input the negative numbers and view the output for different test cases
  • CODING ARENA::
  • #include <stdio.h>
    int main()
    {
      int a,b,c;
      scanf("%d %d",&a,&b);
      c=a%b;
      printf("%d",c);

    return 0;
    }
  • Test Case 1

    Input (stdin)
    100 93
    
    
    Expected Output
    7
  • Test Case 2

    Input (stdin)
    200 12
    
    
    Expected Output
    8

No comments:

Post a Comment