- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C program to print a string without any quote in the program
This is another tricky problem. In this program, we will see how to print a string using C where no quotation marks are used.
Here we are using macro function. We are defining a macro function like
#define getString(x) #x
The getString() is a macro function. It returns x by converting it into a string. The # before x is denoting that the function will convert x into a string.
Input: Take one string without quote Output: Print that string into console
Algorithm
Step 1:Take a string without quote Step 2: Use macro function to print it into a string Step 3: End
Example Code
#include<stdio.h> #define getString(x) #x //The # will convert x into a string main() { printf(getString(Hello World)); }
Output:
Hello World
- Related Articles
- C program to print number series without using any loop
- Java Program to print Number series without using any loop
- Print Number series without using any loop in Python Program
- Golang Program to Print the Numbers in a Range (1, upper) without Using any Loops
- Python Program to Print Numbers in a Range (1,upper) Without Using any Loops
- Write a C program to print ‘ABCD’ repeatedly without using loop, recursion and any control structure
- Python Program for Print Number series without using any loop
- Java Program to display double and single quote in a string
- C program to print the ASCII values in a string.
- C program to print string tokens
- C Program to print “Hello World!” without using a semicolon
- Python Program to Print All Permutations of a String in Lexicographic Order without Recursion
- Print shortest path to print a string on screen in C Program.
- C program to print characters without using format specifiers
- Print a pattern without using any loop in C++

Advertisements