Wednesday, 29 May 2013

Knight Rider - C program



This is a program I created when I stumbled upon the system calls of C programming.It is very easy to understand.Hope you'll like it.


#include <windows.h>
#include <stdio.h>
/*ZINHAYA. ;) */ 

int main() 
{
    int intRef1 = 0, intRef2 = 0;

 printf("Like Zinhaya ;)");
 sleep(300);

for(;0 == 0;)
{


for(intRef1 = 0; intRef1 < 60; intRef1++)

{
for(intRef2 = 0; intRef2 < intRef1; intRef2++)
{
printf(" ");
}
printf("***");
Sleep(100);
system("cls");
}

for(intRef1 = 59; intRef1 > 0; intRef1--)

{
for(intRef2 = 0; intRef2 < intRef1; intRef2++)
{
printf(" ");
}
printf("***");
Sleep(50);
system("cls");
}

    

}
return 0;

Comment if you can improve the code...Thanks.


No comments:

Post a Comment