|
Technical Interview Questions
Visual Basic Interview Question
ASP .NET Interview Questions
C++ Interview Questions
C
Interview Questions
.........More
Programming Source Codes
C/C++ Source Codes
C# Source Codes
.........More
Aptitude Interview Questions
C/C++ Aptitude Questions
C Aptitude Questions
.........More
Tutorials
C Tutorial
C++ Tutorial
.........More
Soft Skills
Communication Skills
Leadership Skills
.........More
|
|
C/C++ Source Codes
menu selection like in
windows
// program to control a line of sign
// control the cursor
//
#include<conio.h>
#include<stdio.h>
#include<process.h>
void main()
{
char ch,
*menu[]={"first ","second","third ","fourth","fifth "},
*first[]={"one","0001"},
*second[]={"two","0002"},
*third[]={"three","0003"},
*fourth[]={"four","0004"};
int i,cur=0;
clrscr();
textcolor(3);
for(i=0;i<=4;i++)
{
gotoxy(8+13*i,3);
cprintf("%s",menu[i]);
}
_setcursortype(0);
while(1)
{
ch=getch();
switch(ch)
{
case 77:
textcolor(3);
textbackground(0);
gotoxy(8+13*cur,3);
cprintf("%s",menu[cur]);
if(cur==4)
cur=0;
else
cur++;
textcolor(0);
textbackground(3);
gotoxy(8+13*cur,3);
cprintf("%s",menu[cur]);
break;
case 75:
textcolor(3);
textbackground(0);
gotoxy(8+13*cur,3);
cprintf("%s",menu[cur]);
if(cur==0)
cur=4;
else
cur--;
textcolor(0);
textbackground(3);
gotoxy(8+13*cur,3);
cprintf("%s",menu[cur]);
break;
case 72:
break;
case 27:
exit(1);
}
}
}
<<<----- Return to
C/C++ Source Code Questions Page.
Have a Question ?
post your questions here. It
will be answered as soon as possible.
Check
Object Oriented Interview
Questions for more Object Oriented Interview Questions with answers
Check
Data Structure
Interview Questions for more data structure interview questions with
answers
|