Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int x;
- int boys=0;
- int girls = 0;
- Console.Write("Enter number of pupils: ");
- int n = int.Parse(Console.ReadLine());
- for (int i = 0; i < n; i++) {
- Console.Write("Enter 1 for male, 2 for female: ");
- x = int.Parse(Console.ReadLine());
- if (x==1)
- {
- boys++;
- }
- else
- {
- girls++;
- }
- }
- if (boys > girls)
- {
- Console.WriteLine("boys");
- }
- else {
- if (girls > boys)
- {
- Console.WriteLine("girls");
- }
- else {
- Console.WriteLine("girls=boys");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement