belongs to collection: C Programs
We can print "hello" or "hello world" or anything else in C without using semicolon. There are various ways to do so:
Let's see a simple c example to print "hello world" using if statement and without using semicolon.
#include<stdio.h> int main() { if(printf("hello world")){} return 0; }
Output:
hello world
Let's see a simple c example to print "hello world" using switch statement and without using semicolon.
#include<stdio.h> int main() { switch(printf("hello world")){} return 0; }
Let's see a simple c example to print "hello world" using while loop and without using semicolon.
#include<stdio.h> int main() { while(!printf("hello world")){} return 0; }
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Program 1: Using if statement
Let's see a simple c example to print "hello world" using if statement and without using semicolon.
Output:
Program 2: Using switch statement
Let's see a simple c example to print "hello world" using switch statement and without using semicolon.
Output:
Program 3: Using while loop
Let's see a simple c example to print "hello world" using while loop and without using semicolon.
Output: