#include<stdio.h>
#include<conio.h>
main()
{
int i,bil1,bil2;
printf("Masukkan 2 buah bilangan:\n");
printf("Bilangan 1= ");
scanf("\n %d", &bil1);
printf("\nBilangan 2= ");
scanf("\n %d", &bil2);
if (bil1<bil2)
{
for(i=bil1;i<=bil2;i++)
{
printf("\n%d",i);
}
}
else if (bil1>bil2)
{
for(i=bil1;i>=bil2;i--)
{
printf("\n%d",i);
}
}
else
printf("%d",bil2);
getche();
}
0 comments:
Posting Komentar