C Program to Print a Semicolon without using a Semicolon anywhere in the Code

«
»

This is a C Program to print a semicolon without using a semicolon anywhere in the code.

Problem Description

This program prints a semicolon without using a semicolon anywhere in the code.

Problem Solution

1. Print the ASCII value of semicolon and exit.

advertisement
Program/Source Code

Here is source code of the C Program to print a semicolon without using a semicolon anywhere in the code. 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 a Semicolon without using a Semicolon
  3.  * anywhere in the code
  4.  */
  5. #include <stdio.h>
  6.  
  7. int main(void)
  8. {
  9.     //59 is the ascii value of semicolumn
  10.     if (printf("%c ", 59))
  11.     {
  12.     }
  13.     return 0;
  14. }
Program Explanation

1. The ASCII value of semicolon is 59.
2. Print this ASCII value and exit.

advertisement
Runtime Test Cases
 
;

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