write a program in c language to get the value of arroy
keys pressed and display the message which arrow key is
pressed?
Answer / mohamed ziavudeen
#define KBHOME 327
#define KBEND 335
#define KBUP 328
#define KBDOWN 336
#define KBPGUP 329
#define KBPGDN 337
#define KBLEFT 331
#define KBINS 338
#define KBRIGHT 333
#define KBDEL 339
c0 = getch();
if (c0==0) {
c1=getch()+256;
if (c1==KBUP)
{
printf("You had hit the upper arrow key");
else if (c1==KBDOWN)
printf("You had hit the DOWN arrow key");
else if (c1==KBLEFT)
printf("You had hit the LEFT arrow key");
else if(c1==KBRIGHT)
printf("You had hit the RIGHT arrow key");
else
printf("You had hit some other key");
}
}
| Is This Answer Correct ? | 1 Yes | 2 No |
void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }
main() { int (*functable[2])(char *format, ...) ={printf, scanf}; int i = 100; (*functable[0])("%d", i); (*functable[1])("%d", i); (*functable[1])("%d", i); (*functable[0])("%d", &i); } a. 100, Runtime error. b. 100, Random number, Random number, Random number. c. Compile error d. 100, Random number
What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
main() { main(); }
main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }
write a c-program to find gcd using recursive functions
How to count a sum, when the numbers are read from stdin and stored into a structure?
plz tell me the solution.......... in c language program guess any one number from 1 to 50 and tell that number within 8 asking question in yes or no...............
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }
# include <stdio.h> int one_d[]={1,2,3}; main() { int *ptr; ptr=one_d; ptr+=3; printf("%d",*ptr); }
void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }
struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above