C program to move text with arrow.

                 Move text with arrow

 


C program to move text with arrow.It is quit difficult program.In this program user will able to move any text with arrow key.Let's discuss the concept behind it.



https://programminghub1999.blogspot.com/2018/12/c-program-to-move-text-with-arrow.html



                    C program to move text with arrow


This program has run in turbo editor.So you can
use this code without hesitation.




#include<stdio.h>
#include<conio.h>
#define KeyUp 72
#define KeyDown 80
#define KeyLeft 75
#define KeyRight 77
void main()
{
   clrscr();
  char ch;
 int x=30,y=10;
 gotoxy(x,y);
 printf("COMPUTER");
while(1)
{
   ch=getch();
   switch(ch)
   {
     case KeyUp: y--;
                             break;
    
case KeyDown: y++; 
                              break;

  case KeyLeft:  x--;
                            break;
case KeyRight:  x++;
                             break;
            case 27: exit(0);
   }
     clrscr();
     gotoxy(x,y);
     printf("COMPUTER");
 }
     getch();
}

  
  This program will move text with arrow key.

















C program to move text with arrow. C program to move text with arrow. Reviewed by Deepak kumar soni on December 29, 2018 Rating: 5

No comments:

Powered by Blogger.