wenesga Posted June 18, 2015 Report Share Posted June 18, 2015 dado um numero inteiro entre 100 a 999, apresenta o inverso deste numero . na linguagem c Quote Link to comment Share on other sites More sharing options...
0 vangodp Posted June 19, 2015 Report Share Posted June 19, 2015 No Google tem muitos exemplos. Aqui nesse mesmo fórum já foi mencionado #include <stdio.h> int inverte ( int num ) { int num_inv = 0; while ( num > 0 ) { num_inv = num_inv * 10 + num % 10; num /= 10; } return num_inv; } int main() { int numero; scanf ( "%d", &numero ); printf ( "\n%d - %d\n", numero, inverte ( numero ) ); return 0; } Tenta entender ele antes de usar ou nunca aprenderás ;) Quote Link to comment Share on other sites More sharing options...
Question
wenesga
dado um numero inteiro entre 100 a 999, apresenta o inverso deste numero . na linguagem c
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.