Computer Project Icse Class 10 Example (For Hint Purpose Only)
Computer Project Icse Class 10 Example (For Hint Purpose Only)
Computer Project Icse Class 10 Example (For Hint Purpose Only)
SUBMITTED TO:-
CLASS:-10TH B
ROLL NUMBER:-32
ADMISSION NUMBER:-7180
INDEX
SERIAL NUMBER TITLE DATE SIGNATURE
SOURCE CODE:-
int num;
Prime(int a)
num=a;
int i;
float prime;
for(i=2;i<=num;i++)
prime=num%i;
if(prime==0)
break;
if(num==i)
System.out.println("Prime Number");
else
OUTPUT:-
Prime Number
6
SOURCE CODE:-
import java.util.Scanner;
int n,c=0,i;
n=sc.nextInt();
for(i=2;i<n;i++)
if(n%i==0)
c++;
if(c>=1)
else
OUTPUT:-
5
Number is not a Composite Number
SOURCE CODE:-
import java.util.Scanner;
int num=sc.nextInt();
int num1,mod;
mod=num%10;
num1=num/10;
if(num1==mod)
System.out.println("Number is Palindrome");
else
OUTPUT:-
import java.util.Scanner;
int number=153;
int check,rem,sum=0;
number=sc.nextInt();
check=number;
while(check!=0)
rem=check%10;
sum=sum + (rem*rem*rem);
check=check/10;
if(sum==number)
else
OUTPUT:-
import java.util.Scanner;
System.out.println("Enter a Number");
while(temp>0)
c++;
temp=temp/10;
if(num == lastSquareDigits)
System.out.println("Automorphic Number");
else
OUTPUT:-
Enter a Number
import java.util.Scanner;
int ans = 0;
if(i*(i+1) == num)
ans = 1;
break;
if(ans == 1)
System.out.println("Pronic Number");
else
OUTPUT:-
Input a Number :
10
SOURCE CODE:-
import java.util.Scanner;
int n=sc.nextInt();
int Sum=0,z=n;
int d=z/10;
while (z>0)
Sum +=d;
z=z/10;
if (n/Sum==0)
else
OUTPUT:-
11
It is a Niven Number
Q.8 NEON NUMBER
SOURCE CODE:-
import java.util.Scanner;
n =sc.nextInt();
int square = n * n;
while(square != 0)
sum = sum+digit;
square = square/10;
if(n == sum)
else
OUTPUT:-
12
12 is not a Neon Number
SOURCE CODE:-
import java.util.Scanner;
int a = in.nextInt();
int b = in.nextInt();
if (a % i == 0)
isAPrime = false;
break;
{
if (b % i == 0)
isBPrime = false;
break;
if (isBPrime)
else
else
OUTPUT:-
22
23
SOURCE CODE:-
import java.util.Scanner;
System.out.println("Enter a Number");
int num=sc.nextInt();
int c = 0;
int r;
while(num!=0)
r=num%10;
if(r==0)
c++;
num=num/10;
if(c>0)
else
OUTPUT:-
Enter a Number
15
SOURCE CODE:-
long n,sum=0;
System.out.println("Enter a Number");
n=sc.nextLong();
int i=1;
while(i<=n/2)
if(n%i==0)
sum+=i;
i++;
if(sum==n)
else
OUTPUT:-
Enter a Number
16
SOURCE CODE:-
import java.util.Scanner;
int num1,num2,mod=0;
num1=sc.nextInt();
num2=sc.nextInt();
while(num1%num2!=0)
mod=num1%num2;
num1=num2;
num2=mod;
OUTPUT:-
Enter Number 1
17
Enter Number 2
18
SOURCE CODE:-
import java.util.Scanner;
int num,i;
System.out.println("Enter a Number");
num=sc.nextInt();
for(i=1;i<=num;i++)
if(num%i==0)
System.out.println(i+"");
OUTPUT:-
Enter a Number
18
18
Q.14 FIND FACTORAL OF ENTERED NUMBER
SOURCE CODE:-
int i,n,fact;
n=5;
fact=1;
for(i=1;i<=n;i++)
fact=fact*i;
OUTPUT:-
SOURCE CODE:-
import java.util.Scanner;
{
public static void main(String args[])
int n=sc.nextInt();
int c=0;
while(n>0)
c++;
n=n/10;
if(c%2==0)
System.out.println("Tech number");
else
OUTPUT:-
20
Tech number
SOURCE CODE:-
import java.util.Scanner;
num=sc.nextInt();
while(num>0)
lastdigit=num%10;
sum=sum+lastdigit;
product=product*lastdigit;
num=num/10;
if(sum==product)
else
OUTPUT:-
22
SOURCE CODE:-
import java.util.Scanner;
{
public static void main(String args[])
int m, n, sum = 0;
m = s.nextInt();
while(m > 0)
n = m % 10;
sum = sum + n;
m = m / 10;
System.out.println("Sum of Digits:"+sum);
OUTPUT:-
24
Sum of Digits:6
SOURCE CODE:-
import java.io.*;
int num=Integer.parseInt(br.readLine());
int num1,fact=1,sum=0,i=0;
int copy_num=num;
while(num>0)
num1=(num%10);
fact=1;
for(i=num1;i>=1;i--)
fact=fact*i;
sum=sum+fact;
num=num/10;
if(sum==copy_num)
System.out.println("**************************************************");
System.out.println("**************************************************");
else
System.out.println("**************************************************");
System.out.println("**************************************************");
OUTPUT:-
Enter Number
26
**************************************************
**************************************************