C Program to Print any Print Statement without using Semicolon

«
»

This is a C Program to print any print statement without using semicolon.

Problem Description

This program prints any print statement without using semicolon.

Problem Solution

1. Use the print statement in the if or else condition.

advertisement
Program/Source Code

Here is source code of the C Program to print any print statement without using semicolon. The C program is successfully compiled and run on a Linux system. The program output is also shown below.

  1. /*
  2.  * C Program to Print any Print Statement without using Semicolon
  3.  */
  4. #include <stdio.h>
  5.  
  6. void main()
  7. {
  8.     if(printf("Hi.. Welcome to sanfoundry"))
  9.     {
  10.     }
  11. }
Program Explanation

1. In the main function use the print statement stating “Hi.. Welcome to sanfoundry” inside the if condition.
2. Exit.

advertisement
Runtime Test Cases
Output:
 
Hi.. Welcome to sanfoundry

Sanfoundry Global Education & Learning Series – 1000 C Programs.

Here’s the list of Best Reference Books in C Programming, Data-Structures and Algorithms

advertisement
If you wish to look at other example programs on Simple C Programs, go to Simple C Programs. If you wish to look at programming examples on all topics, go to C Programming Examples.

advertisement
advertisement
advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn