Page 123 - C Programming
P. 123

ตัวอย่างที่ 9-2  โปรแกรมนับ 0 ถึงจํานวนตัวเลขที่กําหนดไว้



                             #include<stdio.h>

                              main()


                                   {   char x,i;


                                        printf("**********************\n");

                                         printf("  Program Counter 0-X  \n");


                                         printf("**********************\n");

                                         printf("Enter Number [0-99] = ");


                                         scanf("%d",&x);


                                         for(i=0;i<=x;i++)

                                            {   gotoxy(5,6);


                                            printf("Counter = [%0.2d]",i);

                                                outport(0x378,i);


                                                delay(5000);


                                             }

                                          gotoxy(8,7);  printf("Shut Down \a\a\a");


                                    }
   118   119   120   121   122   123   124   125   126   127   128