Professional Documents
Culture Documents
//pair of vowels
class Firstterm1
char ch1,ch2;
void main(String s)
s=s.toUpperCase();
len=s.length();
ch1=s.charAt(i);
ch2=s.charAt(i+1);
if ((ch1=='A' || ch1 =='E' || ch1 =='I' || ch1 =='O' || ch1 =='U') && (ch2=='A' || ch2 =='E' ||
ch2 =='I' || ch2 =='O' || ch2 =='U'))
System.out.println(ch1+" "+ch2);
c=c+1;
}
2nd Program
//to print the palindrome between two given numbers
import java.util.*;
class Palindrome
void main(String[]args)
int b,r=0,n;
int N=sc.nextInt();
for(int i=1;i<=N;i++)
n=i;
while(n>0)
b=n%10;
r=r*10+b;
n=n/10;
if(r==i)
System.out.print(i+" ");
r=0;
}
}
3rd Program
//menu driven
import java.util.*;
class Menu
int ch,k;
void main()
ch=sc.nextInt();
switch (ch)
case 1:
k=1;
System.out.print(k+" ");
k++;
}
System.out.println();
break;
case 2:
char k='A';
System.out.print(k+" ");
k++;
System.out.println();
break;
default :
System.out.println("wrong choice");