TCS Coding Solution 3AM{We Are Continues Updating Solution so Stay Connected}

1. First Code

#include <iostream>  

using namespace std;  

int main()  

{  

int n, reverse=0, rem;    

cout<<“Enter a number: “;    

cin>>n;    

  while(n!=0)    

  {    

     rem=n%10;      

     reverse=reverse*10+rem;    

     n/=10;    

  }    

 cout<<“Reversed Number: “<<reverse<<endl;     

return 0;  

}  

2 CARD GAME CODE C++

2nd CODE in Pyhton

n=input()
li=list(n)
li.sort()
res=””
for i in li:
    res+=i
print(res)

Python

Leave a Comment