#include <windows.h>
#include <stdio.h>
#include <conio.h>
void gotoxy(int x,int y);
int main(int argc, char *argv[])
{
char urname[1],surname[1],fullname[1];
start:
system("COLOR 1c");
gotoxy(11,9);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291);
printf(" ");
gotoxy(11,10);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291);
printf(" ");
gotoxy(11,11);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291);
printf(" ");
gotoxy(11,12);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291);
printf(" ");
gotoxy(11,13);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291);
printf(" ");
gotoxy(11,14);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291);
printf(" ");
gotoxy(11,15);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291);
printf(" ");
gotoxy(14,10);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),121);
printf(" Please enter your name: ");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),151);
printf(" ");
gotoxy(14,12);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),121);
printf(" Please enter your surname: ");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),151);
printf(" ");
gotoxy(14,14);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),121);
printf(" Your name is: ");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),151);
printf(" ");
gotoxy(45,10);
gets(urname);
gotoxy(45,12);
gets(surname);
gotoxy(45,14);
printf("%s %s",urname,surname);
gets(fullname);
{
char choice;
gotoxy(35,11);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),11);
printf(" Do you want to enter ");
gotoxy(35,12);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),11);
printf(" another entry? ");
gotoxy(35,13);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),11);
printf(" YES ");
gotoxy(40,13);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),11);
printf(" NO ");
choice= getche();
if (choice=='y'){
goto start;
}
else
printf("BYE");
}
}
void gotoxy(int x, int y){
COORD coord = {x,y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
}
Zsmash 0 Newbie Poster
thanhvy 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Zsmash 0 Newbie Poster
Zsmash 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.