Zoho Interview | Set 2 Question 3

Form a number system with only 3 and 4. Find the nth number of the number system.

Eg.) The numbers are: 3, 4, 33, 34, 43, 44, 333, 334, 343, 344, 433, 434, 443, 444, 3333, 3334, 3343, 3344, 3433, 3434, 3443, 3444 ….

My Solution::

```#include<stdio.h>
#include<conio.h>

void bin(int n){
if(n>1)
bin(n/2);
printf("%d",(n%2)?3:4);
}

int main(){
int num,i;
clrscr();
scanf("%d",&num);
i = 1;
do{
num -= 1<<i;
i++;
}while(num);
--i;
--i;
num += 1<<i;
bin(num);
getch();
return 0;
}```

1. This comment has been removed by the author.

Hackerrank > SQL > Basic Select

Select
01-Select All
Given a City table, whose fields are described as +-------------+----------+ | Field       | Type     | +-------------+----------+ | ID          | int(11)  | | Name        | char(35) | | CountryCode | char(3)  | | District    | char(20) | | Population  | int(11)  | +-------------+----------+
write a query that will fetch all columns for every row in the table.

My Solution
SELECT*FROM city;
---------------------------------------------------------------------------------
02-Select by ID
Given a City table, whose fields are described as