06-01-2006, 20:20
|
|
|
חבר מתאריך: 24.11.05
הודעות: 317
|
|
בבקשה, תהנה!
בבקשה, תהנה!
קוד:
#include <stdio.h>
#include <conio.h>
int main ()
{
int N1,N2,big,small,I,ahadot,sum=0;
printf("Enter first number-->");
scanf("%d",&N1);
printf("Enter second number-->");
scanf("%d",&N2);
if (N1>N2)
{
big=N1;
small=N2;
}
else
{
big=N2;
small=N1;
}
for (I=small;I<=big;I++)
{
ahadot=I%10;
sum=sum+ahadot;
}
printf("The summary of the ahadot is %d",sum);
getch();
}
|