Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<windows.h>
- #include<conio.h>
- int gotoxy(int x,int y)
- {
- COORD coord;
- coord.X=x;
- coord.Y=y;
- SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
- }
- main()
- {
- menu2:
- system("cls");
- system("color 0D");
- long int W;
- int V,I,T;
- char jawab;
- gotoxy(76,6);printf("$");
- gotoxy(76,10);printf("$");
- gotoxy(76,10);printf("$");
- gotoxy(76,11);printf("$");
- gotoxy(76,12);printf("$");
- gotoxy(76,13);printf("$");
- gotoxy(76,14);printf("$");
- gotoxy(76,15);printf("$");
- gotoxy(76,16);printf("$");
- gotoxy(76,17);printf("$");
- gotoxy(76,18);printf("$");
- gotoxy(76,19);printf("$");
- gotoxy(76,20);printf("$");
- gotoxy(4,6);printf("$");
- gotoxy(4,9);printf("$ ======================================================================$");
- gotoxy(4,10);printf("$");
- gotoxy(4,11);printf("$ =====================================================================");
- gotoxy(4,12);printf("$");
- gotoxy(4,13);printf("$ =====================================================================");
- gotoxy(4,14);printf("$");
- gotoxy(4,15);printf("$");
- gotoxy(4,16);printf("$");
- gotoxy(4,17);printf("$ ====================================================================");
- gotoxy(4,18);printf("$");
- gotoxy(4,19);printf("$");
- gotoxy(4,5);printf("$*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*$");
- gotoxy(4,20);printf("$_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*#");
- gotoxy(4,7);printf("$ PROGRAM MENGHITUNG ENERGI LISTRIK $");
- gotoxy(4,8);printf("$ Silahkan Masukkan beda potensial,arus listrik&lama listrik mengalir $");
- gotoxy(65,10);printf("(V)Volt");
- gotoxy(16,10);printf(" Masukkan beda potensial listrik : ");scanf ("%d",&V);
- gotoxy(65,12);printf("(I)Ampere");
- gotoxy(15,12);printf(" Masukkan kuat arus listrik : ");scanf ("%d",&I);
- gotoxy(65,14);printf("(T)waktu");
- gotoxy(15,14);printf(" Masukkan lama aliran listrik mengalir : ");scanf ("%d",&T);
- gotoxy(15,16);printf(" Hasil energi listrik adalah : ");
- W=V*I*T;
- printf("%ld",W);
- gotoxy(65,16);printf("Ampere");
- gotoxy(15,23);printf(" Apakah Anda Ingin Mengulanginya Lagi ? (Y/T) = ");
- scanf("%s",&jawab);
- if(jawab== 'Y'||jawab== 'y')
- goto menu2;
- else(jawab== 'T'||jawab== 't');
- gotoxy(15,20);printf(" :::>>> Tekan Enter Ke Menu Utama <<<::: ");
- gotoxy(15,22);printf(" ========================= ");
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement