Solution for Codechef FLOW002 | Find Remainder

Hello Programmers,

The solution for codechef Find Remainder problem is given below.

Problem Link:- https://www.codechef.com/problems/FLOW002

/*
*   Author:- Rahul Malhotra
*   Source:- Programming Vidya
*   Description:- Solution for Codechef FLOW002 problem
*   Problem Link:- https://www.codechef.com/problems/FLOW002
*   Website:- www.programmingvidya.com
*/

#include<iostream>

using namespace std;

int main()
{
    // * Initializing variables
    int t, a, b;

    // * Accepting the number of test cases
    cin>>t;

    // * For each test case, displaying the remainder when a is divided by b
    while(t--)
    {
        cin>>a>>b;
        cout<<a%b<<endl;
    }

    return 0;
}

Happy Coding..!!

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s