I have a wifi scanner which shows me the MAC addresses of the wifi routers nearby.
It displays SSIDs in one column and MAC addresses in another column.
I want to know the ip address of the router. what should I do?
WLAN is in the OSI-Model at layer 2 while IP is at layer 3. You need to first have full access to the layer 2 before you can get the information from layer 3. This means that for a WLAN without encryption you can probably see the information by using wireshark, but for a WLAN with encryption you need to decrypt the data first because the encryption is at layer 2. According to the documentation wireshark is able to decrypt WEP and WPA/WPA2 traffic in pre-shared mode if the passphrase is known.
There is no universal way to do this, and if you simply have a Wifi scanner, you really can't do much beyond what it gives you.
From here, my answer has to depend on the purpose of why you are trying to find this out.
If your goal is penetration testing, your focus should be on the encryption. If you can't get through the encryption, the IP addresses aren't going to help you (nor will they even be visible to you). SSID and MAC are both unencrypted, which is why you can easily see them on your scanner.
In most other cases - all that I can think of - the answer will be "ask whoever operates the WiFi router".
The second problem is that there is no 1:1 relationship between IP address and MAC address. Even if there is no encryption involved, the router's Mac address would be used by the router's IP address, but also by all IP addresses behind the router. The bridging between the wired and wireless parts of such a router adds yet more complications.
Also, you don't even necessarily know if the device has an IP address at all - it may be using a different protocol (although non-IP protocols are rare nowadays, you may only be thinking IPv4, while the device could conceivably have only an IPv6 address).
The only other thing you could try is to listen to the ARP protocol traffic.