===========================================================================
CODING
#include<all.h>
void main()
{
clrscr();
long i,a=1,o,e,p,sum,A,x,w,r,j,z,q,g,n,s,d,y,l;
for(i=1,o=0,e=0,A=0,x=0,p=0,q=1,y=2,l=1;a!=0;i++,q=1,y=y+2)
{
gotoxy(l+1,y);
cout<<" Enter number: ";
gotoxy(16+l,y);
cin>>a;
if(a%2==0)
e=e+1;
else
o=o+1;
for(j=2;j<=sqrt(a);j++)
{
z=a%j;
if(z==0)
q=0;
}
if(a==1)
q=0;
if(q!=0)
p=p+1;
for(r=1,n=0,w=a;w!=0;r++)
{
w=w/10;
n=n+1;
}
for(r=1,sum=0,w=a;r<=n;r++)
{
d=w%10;
w=w/10;
sum=sum+pow(d,3);
}
if(sum==a)
A=A+1;
x=x+a;
gotoxy(1,23);
cout<<"----------------------------------------LOG---------------------------------------";
gotoxy(1,24);
cout<<" S._No.= Odd_No.= Even_No.= Armstr._No.= Prime_No.= Sum= ";
gotoxy(11,24);
cout<<i;
gotoxy(23,24);
cout<<o;
gotoxy(36,24);
cout<<e;
gotoxy(52,24);
cout<<A;
gotoxy(66,24);
cout<<p;
gotoxy(74,24);
cout<<x;
if(y==22)
{
y=0;
l=20+l;
if(l==81)
{
l=1;
clrscr();
gotoxy(1,23);
cout<<"----------------------------------------LOG-------------------------------------";
gotoxy(1,24);
cout<<" S._No.= Odd_No.= Even_No.= Armstr._No.= Prime_No.= Sum= ";
gotoxy(11,24);
cout<<i;
gotoxy(23,24);
cout<<o;
gotoxy(36,24);
cout<<e;
gotoxy(52,24);
cout<<A;
gotoxy(66,24);
cout<<p;
gotoxy(74,24);
cout<<x;
}
}
}
getch();
}
CODING
#include<all.h>
void main()
{
clrscr();
long i,a=1,o,e,p,sum,A,x,w,r,j,z,q,g,n,s,d,y,l;
for(i=1,o=0,e=0,A=0,x=0,p=0,q=1,y=2,l=1;a!=0;i++,q=1,y=y+2)
{
gotoxy(l+1,y);
cout<<" Enter number: ";
gotoxy(16+l,y);
cin>>a;
if(a%2==0)
e=e+1;
else
o=o+1;
for(j=2;j<=sqrt(a);j++)
{
z=a%j;
if(z==0)
q=0;
}
if(a==1)
q=0;
if(q!=0)
p=p+1;
for(r=1,n=0,w=a;w!=0;r++)
{
w=w/10;
n=n+1;
}
for(r=1,sum=0,w=a;r<=n;r++)
{
d=w%10;
w=w/10;
sum=sum+pow(d,3);
}
if(sum==a)
A=A+1;
x=x+a;
gotoxy(1,23);
cout<<"----------------------------------------LOG---------------------------------------";
gotoxy(1,24);
cout<<" S._No.= Odd_No.= Even_No.= Armstr._No.= Prime_No.= Sum= ";
gotoxy(11,24);
cout<<i;
gotoxy(23,24);
cout<<o;
gotoxy(36,24);
cout<<e;
gotoxy(52,24);
cout<<A;
gotoxy(66,24);
cout<<p;
gotoxy(74,24);
cout<<x;
if(y==22)
{
y=0;
l=20+l;
if(l==81)
{
l=1;
clrscr();
gotoxy(1,23);
cout<<"----------------------------------------LOG-------------------------------------";
gotoxy(1,24);
cout<<" S._No.= Odd_No.= Even_No.= Armstr._No.= Prime_No.= Sum= ";
gotoxy(11,24);
cout<<i;
gotoxy(23,24);
cout<<o;
gotoxy(36,24);
cout<<e;
gotoxy(52,24);
cout<<A;
gotoxy(66,24);
cout<<p;
gotoxy(74,24);
cout<<x;
}
}
}
getch();
}
===========================================================================
No comments:
Post a Comment