+4

Can you print anything without using semicolon in C language ? if yes, how ?

c++ c

10/21/2019 9:19:29 AM

Rachit Sharma

17 Answers

New Answer

+4

https://www.sololearn.com/Discuss/1687822/?ref=app https://www.sololearn.com/Discuss/1607431/?ref=app https://www.sololearn.com/Discuss/1002956/?ref=app

+5

I think a feed post will be more effective than the discussion we're having here :)

+4

Why you ask a question when you know the answer? you can search the forum for something similar, every once in a while someone came up with something like this. (Edit) https://www.sololearn.com/Discuss/1729434/?ref=app

+3

#define Semicolon ; int main(){ printf ("this ") Semicolon return 0 Semicolon }

+2

I don't understand.

+2

Yes, We can print anything in C without using semicolon. Using if, switch, loop etc For ex:- Using if statement int main() { if(printf("hello world")){} return 0;}    

+2

Yeah it's possible to print anything without semicolon.... #include<stdio.h> int main() { if(printf("hello frnds how you all")) {} return 0; } It's a interview questions . Note:condition if is a method{} curlybraces don't forget Thank you guy's

+1

Nope. You can try using python.

+1

But what's the point of doing that?

+1

Gellert ya right thinking of the same thing

+1

Gellert why not spread knowledge ? isn't that a good thing to do ?

+1

+1

void main() { if(printf ("hello")){} }

0

what if I told you there is a way using switch statement among various other ways !

0

We can do it using the switch statement in C language, it's a simple piece of code.

0

Yes, I know but I thought there might be other ways as well that I might not be aware of :)

0

Exactly Vandana that's correct ! but there are other methods as well