Write a URL in a C++ program
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.
Recommended Posts:
- Write a C program that won't compile in C++
- Write a program that produces different results in C and C++
- Write a C program that does not terminate when Ctrl+C is pressed
- When should we write our own copy constructor?
- Write your own memcpy() and memmove()
- When should we write our own assignment operator in C++?
- Does C++ compiler create default constructor when we write our own?
- Read/Write Class Objects from/to File in C++
- How to write long strings in Multi-lines C/C++?
- lseek() in C/C++ to read the alternate nth byte and write it in another file
- Is it fine to write "void main()" or "main()" in C/C++?
- Output of C Program | Set 29
- How to compile 32-bit program on 64-bit gcc in C and C++
- Program for n-th even number
- Program to compare m^n and n^m
Improved By : jit_t



