download disini untuk aplikasinya : stoikiometri-konsepmol.exe
dibawah ini source codenya
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
void nyarijmlhpartikel()
{float mol,jml_partikel; float L=6.023;
puts("\n===========================================\n");
printf("\nmasukkan mol= "); scanf("%f",&mol);fflush(stdin);
jml_partikel=mol*L; printf("\njml partikel=mol x L= %f x (%fx10^23)= %fx10^-23\n",mol,L,jml_partikel);
}
void nyarimassa()
{float mol,Mr,gram;
puts("\n===========================================\n");
printf("\nmasukkan mol= "); scanf("%f",&mol);fflush(stdin);
printf("\nmasukkan Ar/Mr= "); scanf("%f",&Mr);fflush(stdin);
gram=mol*Mr; printf("\nmassa=mol x Mr= %f x %f= %f\n",mol,Mr,gram);}
void nyariMr()
{float gram,mol,Mr;
puts("\n===========================================\n");
printf("\nmasukkan massa= "); scanf("%f",&gram);fflush(stdin);
printf("\nmasukkan mol= "); scanf("%f",&mol);fflush(stdin);
Mr=gram/mol; printf("\nMr=gram/mol= %f/%f= %f\n",gram,mol,Mr);}
void nyarimol()
{float branch,subbranch,jml_partikel,gram,mol,Mr;
float L=6.023;
puts("\n===========================================\n");
printf("tekan a jika var yang diketahui jml partikel\ntekan b jika var yang diketahui gram dan Mr");
subbranch=getche();
if(subbranch=='a')
{puts("\n===========================================\n");
printf("\nmasukkan jumlah partikel= "); scanf("%f",&jml_partikel);
mol=jml_partikel/L; printf("\nmol=jumlah partikel/L= %f/(%fx10^23)= %fx10^-23\n",jml_partikel,L,mol);}
else if(subbranch=='b')
{puts("\n===========================================\n");
printf("\nmasukkan massa= "); scanf("%f",&gram);fflush(stdin);
printf("\nmasukkan Mr = "); scanf("%f",&Mr);fflush(stdin);
mol=gram/Mr; printf("\nmol=massa/Mr= %f/%f= %f\n",gram,Mr,mol);}
}
int main () {
float branch,subbranch,jml_partikel,gram,mol,Mr;
float L=6.023;
do{
system("cls");
printf("\t\t\tPROGRAM PENGHITUNG KIMIA\n\n");
printf("variabel apa yang ingin dicari?\n");
printf("<a>jumlah partikel <b>massa <c>Mr/Ar <d>mol <q>exit\n");
printf("masukkan huruf: ");branch=getche();fflush(stdin);
if (branch=='a') {nyarijmlhpartikel();getch();}
else if(branch=='b') {nyarimassa();getch();}
else if(branch=='c') {nyariMr() ;getch();}
else if(branch=='d') {nyarimol(); getch();}
else if(branch=='q') printf("\n\nterimakasih :)\n");
else printf("\n\n\nmaaf data yang anda masukkan salah!!!\n\n");
}
while(branch!='q');
system("pause");
return (0);
}
#include<stdlib.h>
#include<conio.h>
void nyarijmlhpartikel()
{float mol,jml_partikel; float L=6.023;
puts("\n===========================================\n");
printf("\nmasukkan mol= "); scanf("%f",&mol);fflush(stdin);
jml_partikel=mol*L; printf("\njml partikel=mol x L= %f x (%fx10^23)= %fx10^-23\n",mol,L,jml_partikel);
}
void nyarimassa()
{float mol,Mr,gram;
puts("\n===========================================\n");
printf("\nmasukkan mol= "); scanf("%f",&mol);fflush(stdin);
printf("\nmasukkan Ar/Mr= "); scanf("%f",&Mr);fflush(stdin);
gram=mol*Mr; printf("\nmassa=mol x Mr= %f x %f= %f\n",mol,Mr,gram);}
void nyariMr()
{float gram,mol,Mr;
puts("\n===========================================\n");
printf("\nmasukkan massa= "); scanf("%f",&gram);fflush(stdin);
printf("\nmasukkan mol= "); scanf("%f",&mol);fflush(stdin);
Mr=gram/mol; printf("\nMr=gram/mol= %f/%f= %f\n",gram,mol,Mr);}
void nyarimol()
{float branch,subbranch,jml_partikel,gram,mol,Mr;
float L=6.023;
puts("\n===========================================\n");
printf("tekan a jika var yang diketahui jml partikel\ntekan b jika var yang diketahui gram dan Mr");
subbranch=getche();
if(subbranch=='a')
{puts("\n===========================================\n");
printf("\nmasukkan jumlah partikel= "); scanf("%f",&jml_partikel);
mol=jml_partikel/L; printf("\nmol=jumlah partikel/L= %f/(%fx10^23)= %fx10^-23\n",jml_partikel,L,mol);}
else if(subbranch=='b')
{puts("\n===========================================\n");
printf("\nmasukkan massa= "); scanf("%f",&gram);fflush(stdin);
printf("\nmasukkan Mr = "); scanf("%f",&Mr);fflush(stdin);
mol=gram/Mr; printf("\nmol=massa/Mr= %f/%f= %f\n",gram,Mr,mol);}
}
int main () {
float branch,subbranch,jml_partikel,gram,mol,Mr;
float L=6.023;
do{
system("cls");
printf("\t\t\tPROGRAM PENGHITUNG KIMIA\n\n");
printf("variabel apa yang ingin dicari?\n");
printf("<a>jumlah partikel <b>massa <c>Mr/Ar <d>mol <q>exit\n");
printf("masukkan huruf: ");branch=getche();fflush(stdin);
if (branch=='a') {nyarijmlhpartikel();getch();}
else if(branch=='b') {nyarimassa();getch();}
else if(branch=='c') {nyariMr() ;getch();}
else if(branch=='d') {nyarimol(); getch();}
else if(branch=='q') printf("\n\nterimakasih :)\n");
else printf("\n\n\nmaaf data yang anda masukkan salah!!!\n\n");
}
while(branch!='q');
system("pause");
return (0);
}
0 comments:
Post a Comment