Thursday, 5 June 2014

Wow

#include<conio.h>
#include<iostream>
#include<windows.h>
#include<stdio.h>
using namespace std;
void gotoxy (int x,int y)
{
    COORD coord;
    coord.X = x; coord.Y = y;
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
int main()
{
int i,j,k,l,len;
char name[20];
gotoxy(35,12);
cout<<"Enter your name: ";
gotoxy(39,13);
gets(name);
Sleep(500);
system("cls");

for(i=0,j=0,k=80,l=24;i<45,j<12,k>40,l>12;i++,j++,k--,l--)
{
gotoxy(i+i*3,12);
cout<<"*";
gotoxy(40,j);
cout<<"*";
gotoxy(k-(i*3),12);
cout<<"*";
gotoxy(40,l);
cout<<"*";
Sleep(200);
system("cls");
}

len=(strlen(name)/2);
for(i=len,j=len;i>0,j<len*2;i--,j++)
{
gotoxy(35+i,12);
cout<<name[i];
gotoxy(35+j,12);
cout<<name[j];
Sleep(300);
}
gotoxy(35+0,12);
cout<<name[0];
gotoxy(35+strlen(name),12);
cout<<name[strlen(name)];


getch();
return 0;
}

Get updated with our page Programming infinitum on facebook.


Naveen Dengani
Shashank Chauhan

No comments:

Post a Comment