Write a URL in a C++ program
Last Updated :
21 Jun, 2022
Writing URLs in programming code doesn’t affect the program and the compiler will not throw any error.
Here, we will how to use Url in various languages without any errors.
The full form of URL is Uniform Resource Locators. URLs are unique they store the address of a particular web application.
C++
#include <iostream>
using namespace std;
int main()
{
https:
for ( int i = 0; i < 5; i++)
{
cout << "This code is error free" << endl ;
}
return 0;
}
|
Java
import java.io.*;
class GFG {
public static void main (String[] args)
{
https:
for ( int i = 0 ; i < 5 ; i++){
System.out.println( "This code is error free" );
}
}
}
|
PHP
<?php
https:
for ( $i = 0; $i < 5; $i ++)
{
echo "This code is error " .
"free" , "\n" ;
}
?>
|
C#
using System;
class Demo {
static void Main() {
for ( int i = 0; i < 5; i++)
Console.WriteLine( "This code is error" );
}
}
|
Javascript
<script>
alert(mainUrl);
for (let i = 0; i < 5; i++) {
document.write( "This code is error" );
}
</script>
|
Output:
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/
Time complexity : O(1)
Auxiliary Space : O(1)
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...