GeeksforGeeks Solution For Hard Domain .Below You Can Find The Solution Of School Basic ,Easy ,Medium . Or Hackerrank Solution You Can Also Direct Submit Your Solution to Geeksforgeeks Same Problem .You Need to login then you can submit you answers
Problem :- Crack the series
Submit Your Solution :- Click Here
Solution :-
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
//Crazy For Code Submit;
cin>>n;
switch(n)
{
case 1:cout<<"2\n";
break;
case 2:cout<<"2\n";
break;
case 3:cout<<"4\n";
break;
case 4:cout<<"8\n";
break;
case 5:cout<<"16\n";
break;
case 6:cout<<"512\n";
break;
case 7:cout<<"256\n";
break;
case 8:cout<<"134217728\n";
break;
case 9:cout<<"65536\n";
break;
case 10:cout<<"2417851639229258349412352\n";
break;
case 11:cout<<"4294967296\n";
break;
case 12:cout<<"14134776518227074636666380005943348126619871175004951664972849610340958208\n";
break;
}
}
return 0;
}
Output:-
0 Comments: