Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- // Leggere e validare un input
- // Condizione input < 5
- // While loop solution
- int n;
- printf("N: ");
- scanf("%d", &n);
- while (n < 5) {
- printf("N: ");
- scanf("%d", &n);
- }
- printf("Numero inserito: %d\n", n);
- // Do while loop solution
- int n;
- do {
- printf("N: ");
- scanf("%d", &n);
- } while (n < 5);
- printf("Numero inserito: %d\n", n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement