Program that can read two number int between [100;999]
And write the sequencial number between final number and inical number
Exemp. inicial number? 255
Final number? 263 Output: 263, 262, 261, 260, 259, 258, 257, 256, 255
Post what you have coded so far (complete code please), and indicate what exactly doesn't work as expected.
int main(int argc, char *argv[])
{
int vi;
int vf;
int i;
printf("Digite o seu numero inicial");
scanf("%d",&vi);
printf("Digite o seu numero final ");
scanf("%d",&vf);
for(i=0;i<vf;i--){
}
(Inside printf is portuguese)
Alrady did, thanks anyway
Glad you found it :)
for(i=vf;i>=vi;i--){
printf("%i ", i);
}
Yeah was that, thanks a lot :)
What about vi < vf or vi = vf :o
vi = min(vi,vf) ;
vf = max(vi,vf) ;
if(vi != vf)
{
while(++vi < vf)
{
printf("%i\n",vi) ;
}
}
Use unsigned int rather than int.
Well, i think that could work too.