Write a program for Implement Interrupt Procedure in C

/* Write a program for Implement Interrupt Procedure in C */
#include<stdio.h>
#include<conio.h>
#include<dos.h>
void main() {
int i,n=0,c=0;
clrscr();
printf(“\n***********************Programm for generating Table*********************** “);
printf(“\nEnter any number>>”);
scanf(“%d”,&n);
for(i=1;i<=10;i++) {
printf(“\n%d X %d = %d”,n,i,(i*n));
delay(2000);
if(kbhit()) {
c=getch();
printf(“\nKey has been pressed……The pressed key is %c “,c);
}
}
getch();
}
/*
****************************OUTPUT**********************

***********************Programm for generating Table***********************
Enter any number>>3

3 X 1 = 3
Key has been pressed……The pressed key is b
3 X 2 = 6
Key has been pressed……The pressed key is r
3 X 3 = 9
Key has been pressed……The pressed key is i
3 X 4 = 12
Key has been pressed……The pressed key is d
3 X 5 = 15
Key has been pressed……The pressed key is e
3 X 6 = 18
Key has been pressed……The pressed key is w
3 X 7 = 21
Key has been pressed……The pressed key is i
3 X 8 = 24
Key has been pressed……The pressed key is n
3 X 9 = 27
3 X 10 = 30

*/

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.