- Using switch
- Using loop etc.
Program 1: Using if statement
Here is a basic C illustration demonstrating how to display the message "hello world" by employing an if statement, all while avoiding the use of a semicolon.
Example
Example
#include<stdio.h>
int main()
{
if(printf("hello world")){}
return 0;
}
Output:
Output
hello world
Program 2: Using switch statement
Here is a straightforward C illustration demonstrating how to output "hello world" by employing a switch statement without the usage of a semicolon.
Example
Example
#include<stdio.h>
int main()
{
switch(printf("hello world")){}
return 0;
}
Output:
Output
hello world
Program 3: Using while loop
Here is a basic C illustration demonstrating how to display "hello world" using a while loop without the utilization of semicolons.
Example
#include <stdio.h>
int main() {
if (printf("hello world\n")) {}
}
Example
Example
#include<stdio.h>
int main()
{
while(!printf("hello world")){}
return 0;
}
Output:
Output
hello world