#include
#include
#include
#define MAX 15
#define DELAY 10000000
#define FIRST 0
#define SECOND 25
#define THIRD 51
#define DEFAULT SetColor(7);
void SetColor(unsigned short);
void GotoXY(int, int);
void Delay(void);
int main(int argc, char *argv[]) {
size_t i, val = MAX;
for(i = 0; i < MAX; ++i) {
GotoXY(FIRST,i);
SetColor(i+1);
puts("Hello World!"); Delay();
}
for(i = 0; i < MAX; ++i) {
GotoXY(SECOND,i);
SetColor(i+2);
puts("Indo-Code.com"); Delay();
}
for(i = 0; i < MAX; ++i, –val) {
GotoXY(THIRD,i);
SetColor(val);
puts("C Programming"); Delay();
}
DEFAULT;
getch();
fflush(stdin);
return(0);
}
void SetColor(unsigned short color) {
HANDLE hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsoleOutput,color);
}
void GotoXY(int x, int y) {
HANDLE hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
COORD dwCursorPosition;
dwCursorPosition.X = x;
dwCursorPosition.Y = y;
SetConsoleCursorPosition(hConsoleOutput,dwCursorPosition);
}
void Delay(void) {
int i = 0;
while(i < DELAY) {
++i;
}
}

0 Comments:

Post a Comment



tab 1 - Click >> Edit

tab 3 - Click >> Edit

tab 2 - Click >> Edit

Tab 5 - Click >> Edit

Tab 4 - Click >> Edit

adsense 300px X 250px

adsense link 728px X 15px