problem HS08TEST run time error

#include<stdio.h>
void main()
{

	int angka1;
	int angka2;
	float sisa=0;
	
	printf("masukkan angka 1 :");
	scanf("%d",&angka1);
	fflush(stdin);
 
	printf("masukkan angka 2 :");
	scanf("%d",&angka2);
	fflush(stdin);
	
	
	if(angka1<angka2 && angka1%5==0)
	{
		printf("%d %d\n",angka1,angka2);
		sisa= angka2-angka1-0.50;
	}
 
		
 
	printf("jumlah uang sisa :%.2f\n",sisa);
 
 
	getchar();
 
 
}

you are printing something which is not part of the output given.u have to print only the specified output.nothing extra.and also use “int main()” instead of “void main()” and “return 0” at end.this is causing runtime error and do stick to input and output format

where is return 0 ??

@sp1rs…just asking…do u read previous comments before commenting???

after i use int main() and return 0. it says wrong answer. what i must do?

did u remove these type of statements: printf(“masukkan angka 1 :”)…no need for these…follow the i/o formats strictly!!!

also no need for this…“angka1>0 && angka2<2000”…it is made sure the inputs that are given follow the constraints…u dont need to worry abt it…:slight_smile:

i didn’t remove at first. but after i remove printf then it works… thx a lot kunal361. do u have any facebook account?? want to add so i can ask easily hehehe. thanks buddy

1 Like