You are on page 1of 2

Lavanya Negi

10C
Roll no 19
Computer practicals
import java.util.*;
class vowelcheck
{
public static void main(String args[])
{
Scanner s = new Scanner(System.in);
System.out.println("Enter the word");
String input = s.nextLine();
int v = 0;
for(int i = 1; i <input.length(); i++)
{
char ch = input.charAt(i);
if(ch == 'a'||ch == 'A'||ch == 'e'||ch == 'e'||ch == 'E'||ch == 'i'||ch == 'I'||ch == 'o'||ch ==
'O'||ch == 'u'||ch == 'U')
{
continue;
}
v++;
}
System.out.println("Number of vowels: " + v);
}
}
import java.util.*;
public class Automorphic
{
public static void main(String args[])
{
Scanner s = new Scanner(System.in);
System.out.println("Enter a number");
int num = s.nextInt();
int sqr = num*num;
int count = 0;
int num1 =num;
while(num1>0)
{
count++;
num1=num1/10;
}
int num2 = (int)(sqr%(Math.pow(10,count)));
if(num == num2)
System.out.println("The number is an Automorphic number");
else
System.out.println("The number is not an Automorphic number");
}
}

You might also like