| 1 | #include<stdio.h> |
| 2 | int main() |
| 3 | { |
| 4 | long long int num; //declaring number as long long integer |
| 5 | scanf("%lld",&num); |
| 6 | |
| 7 | printf("%lld",num); |
| 8 | |
| 9 | while(num!=1) //loop works until number is not equals to 1 |
| 10 | { |
| 11 | if(num%2==0) //if number is even |
| 12 | num=num/2; //dividing the number by 2 |
| 13 | |
| 14 | else //else number is odd |
| 15 | num=(num*3)+1; //multiplying the number by 3 and then adding 1 to it |
| 16 | |
| 17 | printf(" %lld",num); //printing the result |
| 18 | } |
| 19 | } |
nothing calls this directly
no outgoing calls
no test coverage detected