
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
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
;
- Related Articles
- C Program to print “Hello World!” without using a semicolon
- Print Hello World without semicolon in C++
- Write a C program to print “ Tutorials Point ” without using a semicolon
- Write a program to print ‘Tutorials Point’ without using a semicolon in C
- C Program to print numbers from 1 to N without using semicolon
- How can we run a MySQL statement without termination semicolon?
- When is a semicolon after } mandated in C++ Program?
- How to Add Semicolon to Each Cell in Excel?
- Semicolon Conventions in Lua Programming
- What does a semicolon do after a C++ class name?
- Can we use semicolon as a MySQL DEMILITER?
- What will happen if a semicolon is misplaced in JavaScript?
- How to find a specific record from a list of values with semicolon in MySQL?
- Do I need to use a semicolon after every function in JavaScript?
- How to split comma and semicolon separated string into a two-dimensional array in JavaScript ?

Advertisements