Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int n,x;
- do{
- printf("\nIngrese un numero distinto de 1: ");
- scanf("%d",&n);
- if(n%2==0){
- n=n/2;
- }
- else{
- n=n*3+1;
- }
- printf("%d",n);
- }while(n!=1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement