
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
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
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