Q:

C program to get IP address

0

C program to get IP address

 

C program to print IP (Internet Protocol) address of your computer, system function is used to execute the command "ipconfig" which prints IP address, subnet mask, and default gateway. The code given below works for Windows XP and Windows 7. If you are using Turbo C compiler then execute this program from the folder, it may not work when you are working in a compiler and trying to run it by Ctrl + F9.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include<stdlib.h>
int main()
{
   system("C:\\Windows\\System32\\ipconfig");
   
   return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now