Advertisement
Guest User

Untitled

a guest
May 21st, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<windows.h>
  3. #include<conio.h>
  4. int gotoxy(int x,int y)
  5. {
  6. COORD coord;
  7. coord.X=x;
  8. coord.Y=y;
  9. SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
  10. }
  11. main()
  12.  
  13. {
  14. menu2:
  15. system("cls");
  16. system("color 0D");
  17. long int W;
  18. int V,I,T;
  19. char jawab;
  20. gotoxy(76,6);printf("$");
  21. gotoxy(76,10);printf("$");
  22. gotoxy(76,10);printf("$");
  23. gotoxy(76,11);printf("$");
  24. gotoxy(76,12);printf("$");
  25. gotoxy(76,13);printf("$");
  26. gotoxy(76,14);printf("$");
  27. gotoxy(76,15);printf("$");
  28. gotoxy(76,16);printf("$");
  29. gotoxy(76,17);printf("$");
  30. gotoxy(76,18);printf("$");
  31. gotoxy(76,19);printf("$");
  32. gotoxy(76,20);printf("$");
  33. gotoxy(4,6);printf("$");
  34. gotoxy(4,9);printf("$ ======================================================================$");
  35. gotoxy(4,10);printf("$");
  36. gotoxy(4,11);printf("$ =====================================================================");
  37. gotoxy(4,12);printf("$");
  38. gotoxy(4,13);printf("$ =====================================================================");
  39. gotoxy(4,14);printf("$");
  40. gotoxy(4,15);printf("$");
  41. gotoxy(4,16);printf("$");
  42. gotoxy(4,17);printf("$ ====================================================================");
  43. gotoxy(4,18);printf("$");
  44. gotoxy(4,19);printf("$");
  45. gotoxy(4,5);printf("$*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*$");
  46. gotoxy(4,20);printf("$_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*#");
  47. gotoxy(4,7);printf("$ PROGRAM MENGHITUNG ENERGI LISTRIK $");
  48. gotoxy(4,8);printf("$ Silahkan Masukkan beda potensial,arus listrik&lama listrik mengalir $");
  49. gotoxy(65,10);printf("(V)Volt");
  50. gotoxy(16,10);printf(" Masukkan beda potensial listrik : ");scanf ("%d",&V);
  51. gotoxy(65,12);printf("(I)Ampere");
  52. gotoxy(15,12);printf(" Masukkan kuat arus listrik : ");scanf ("%d",&I);
  53. gotoxy(65,14);printf("(T)waktu");
  54. gotoxy(15,14);printf(" Masukkan lama aliran listrik mengalir : ");scanf ("%d",&T);
  55. gotoxy(15,16);printf(" Hasil energi listrik adalah : ");
  56. W=V*I*T;
  57. printf("%ld",W);
  58. gotoxy(65,16);printf("Ampere");
  59. gotoxy(15,23);printf(" Apakah Anda Ingin Mengulanginya Lagi ? (Y/T) = ");
  60. scanf("%s",&jawab);
  61. if(jawab== 'Y'||jawab== 'y')
  62. goto menu2;
  63. else(jawab== 'T'||jawab== 't');
  64. gotoxy(15,20);printf(" :::>>> Tekan Enter Ke Menu Utama <<<::: ");
  65. gotoxy(15,22);printf(" ========================= ");
  66. getch();
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement