0% found this document useful (0 votes)
3 views

Ny

Uploaded by

ishanr970
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Ny

Uploaded by

ishanr970
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

import java.util.

*;
class sp3
{
void main()
{
int m,n,i,k,bk,f=0,ds=0,d,c=0;
Scanner sc=new Scanner(System.in);
System.out.println("INPUT:");
System.out.println("Enter the lower range");
m=sc.nextInt();
System.out.println("Enter the upper range");
n=sc.nextInt();
if(n>m)
{
System.out.println("THE COMPOSITE MAGIC INTEGERS ARE:");
for(i=m;i<=n;i++)
{
f=0;ds=0;
for(k=1;k<=i;k++)
{
if(k%i==0)
{
f++;

}
}
bk=i;
while(bk>9)
{
ds=0;
while(bk!=0)
{
d=bk%10;
ds=ds+d;
bk=bk/10;
}
bk=ds;
}
if(bk==1 && f>2)
{
c++;
System.out.println(i);
}
}
if(c==0)
{
System.out.println("NOT FOUND");
System.out.println("FREQUENCY OF COMPOSITE MAGIC INTEGERS IS: 0");
}
else
{
System.out.println("FREQUENCY OF COMPOSITE MAGIC INTEGERS IS: "+c);
}
}
else
{
System.out.println("INVALID CHOICE");
}
}
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy