wap to print and check nelson number
Answers
Answer:
Java programming exercises and solution: Write a Java program to check whether a given number is a Disarium
A nelson number is a number with multiples of 111.
Program to print and check nelson number in c# is:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace nelson _no
{
class nelson
{ static void Main(string[] args)
{
Console.WriteLine ("Enter the number to check:");
int check_nelson = int.Parse ( Console.ReadLine() );
if (check_nelson == 111 || check_nelson == 222 || check_nelson == 333 ||
check_nelson == 444 || check_nelson == 555 || check_nelson == 666 ||
check_nelson == 777 || check_nelson == 888 || check_nelson == 999)
Console.WriteLine ( " It is a nelson number " );
else
Console.WriteLine (" It is not a nelson number");
}
}
}