Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <windows.h>
- void main()
- {
- int option,option2, pos=0;
- while(1)
- {
- option=getch();
- if(option==0)
- {
- option2=getch();
- if(option2 == 72)
- {
- pos+=1;
- printf("%d", pos);
- }
- else if(option2 == 80)
- {
- pos-=1;
- printf("%d",pos);
- }
- }
- system("pause");
- system("cls");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment