Answer to Question #305292 in C# for Nica Vergara

Question #305292

We Filipinos are quite known for the habit of leaving at least one of the many pieces of food on the plate as it can't be equally divided among all at most times. Just like when 3 people decide to eat a pizza of 10 slices, there will often be at least one slice left on the box. To accurately show just how many pieces of things are left when divided by a certain number, we code it using modulo.

Care to do it for me?


Input

A line containing two integers separated by a space.

10·3

Output

A single line containing an integer.

1





1
Expert's answer
2022-03-03T09:59:08-0500
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
 
            Console.WriteLine("Input: ");
            string input = Console.ReadLine();
            string[] arr = input.Split(' ');
            int c1 = Convert.ToInt32(arr[0]);
            int c2 = Convert.ToInt32(arr[1]);

            int modulo = c1 % c2;
             
            Console.WriteLine(modulo);
            

            Console.ReadKey();
        }
 
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS