Writing URLs in programming code doesn’t affect the program and the compiler will not throw any error.
C++
// C++ program to demonstrate URL in code #include <iostream> using namespace std; int main() { https://www.geeksforgeeks.org/ for (int i = 0; i < 5; i++) { cout << "This code is error free" << endl ; // Uncommenting below goto statement causes // infinite loop // goto http; } return 0; } |
chevron_right
filter_none
PHP
<?php // PHP program to demonstrate // URL in code https://www.geeksforgeeks.org/ for ($i = 0; $i < 5; $i++) { echo "This code is error " . "free" , "\n" ; // Uncommenting below // goto statement causes // infinite loop // goto https; } // This code is contributed // by m_kit ?> |
chevron_right
filter_none
Output:
This code is error free This code is error free This code is error free This code is error free This code is error free
Explanation:
- Any identifier followed by a : becomes a (goto) labels in a Program.
- A single line comment begins with a // and so in https://www.geeksforgeeks.org/ and so it is a comment. And therefore:
label- http:
comment- www.geeksforgeeks.org/
This article is contributed by MAZHAR IMAM KHAN. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don't stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
Recommended Posts:
- Write a C program that does not terminate when Ctrl+C is pressed
- Write a C program that won't compile in C++
- Write a program that produces different results in C and C++
- When should we write our own copy constructor?
- Does C++ compiler create default constructor when we write our own?
- When should we write our own assignment operator in C++?
- Is it fine to write "void main()" or "main()" in C/C++?
- Write your own memcpy() and memmove()
- lseek() in C/C++ to read the alternate nth byte and write it in another file
- How to write long strings in Multi-lines C/C++?
- Read/Write Class Objects from/to File in C++
- Hello World Program : First program while learning Programming
- Program for Sum of the digits of a given number
- Quine - A self-reproducing program
- Program to compute Log n
- Output of C++ Program | Set 10
- Output of C++ Program | Set 14
- Output of C++ Program | Set 16
- Output of C++ Program | Set 18
- Program to print last 10 lines
Improved By : jit_t

