Tuesday, 4 September 2018

A.I.

===========================================================================
                                CODING



#include<all.h>

void main()
{
     clrscr();
     long i,j,n,N,a1,a2,a,n2,a3,n3,m;
     randomize();
     first();
     second();
     gotoxy(35,1);
     cprintf("HELLO USER!");
     gotoxy(19,3);
     cprintf("My Name is \"GIDEON\", your Personal A.I.");
     gotoxy(27,5);
     cprintf("Please enter a Number: ");
     cscanf("%ld",&n);
     gotoxy(9,7);
     cprintf("Hey! did I told you that i can Predict anything in your Mind!!");
     gotoxy(28,9);
     cprintf("So Let me Predict, Wait  ");
     for(i=1;i<=20;i++)
     {
if(i%2==0)
cprintf("\b\\");
else
cprintf("\b\/");
sound(i*100);
delay(300);
     }
     nosound();
     for(N=n,i=0;N!=0;i++)
     {
N=N/10;
     }
     if(n==0)
     N=m=1;
     else
     N=m=i;
     a1=(n-2)+2*pow(10,N);

     gotoxy(1,9);
     cprintf("So According to my Calculations the Sum of 4 Upcoming Numbers and the first one");
     gotoxy(33,10);
     cprintf("Would be: %ld",a1);
     gotoxy(27,12);
     cprintf("Now Lets see if That's TRUE");
     getch();
     getch();
     gotoxy(13,14);
     cprintf("Enter any No. with same no. of Digits as Before: ");
     cscanf("%ld",&n2);
     for(i=0,a2=0,N=n2;i!=m;i++)
     {
j=N%10;
N=N/10;
j=9-j;
a2=a2+j*pow(10,i);
     }
     gotoxy(30,16);
     cprintf("So let Me Randomize  ");
     for(i=1;i<=20;i++)
     {
if(i%2==0)
cprintf("\b\\");
else
cprintf("\b\/");
sound(i*100);
delay(300);
     }
     nosound();
     gotoxy(26,16);
     cprintf("So from my side no. would be: %ld",a2);
     getch();
     getch();
     gotoxy(11,18);
     cprintf("Enter another No. with same no. of Digits as Before: ");
     cscanf("%ld",&n3);
     for(i=0,N=n3,a3=0;i!=m;i++)
     {
j=N%10;
N=N/10;
j=9-j;
a3=a3+j*pow(10,i);
     }
     gotoxy(30,20);
     cprintf("So let Me Randomize  ");
     for(i=1;i<=20;i++)
     {
if(i%2==0)
cprintf("\b\\");
else
cprintf("\b\/");
sound(i*100);
delay(300);
     }
     nosound();
     gotoxy(26,20);
     cprintf("So from my side no. would be: %ld",a3);
     getch();
     getch();
     gotoxy(16,22);
     cprintf("Adding:  %ld + %ld + %ld + %ld + %ld",n,n2,a2,n3,a3);
     gotoxy(33,24);
     cprintf("We get: %ld",(n+n2+n3+a2+a3));
     gotoxy(41,24);
     textcolor(YELLOW+BLINK);
     cprintf("%ld",(n+n2+n3+a2+a3));
     gotoxy(43,10);
     textcolor(YELLOW+BLINK);
     cprintf("%ld",a1);
     getch();
}




===========================================================================

                                OUTPUT


PLEASE CLICK HERE FOR OUTPUT VIDEO

No comments:

Post a Comment