 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to print a semicolon(;) without using semicolon in C/C++?
In this tutorial, we will be discussing a program to understand how to print a semicolon(;) without using a semicolon in /C++.
This can be done in two possible ways, either by using the ascii value of semicolon or using user-defined macros for the same.
Example
Using putchar() method
#include <stdio.h> int main(){    //ASCII value of semicolon is equal to 59    if (putchar(59)){    }    return 0; }  Output
;
Example
Using Macros :
#include <stdio.h> #define POINT printf("%c",59) int main(){    if (POINT) {    } } Output
;
Advertisements
 