Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
+1 vote
782 views
in C Programming by (178k points)
Is there a way to print text without a new line?

Please log in or register to answer this question.

1 Answer

0 votes
by (178k points)

By default, the printf function adds a new line character (\n) at the end of each printed line. However, you can use the printf function with the format specifier %s to print text without a new line. 

Here's an example:

#include <stdio.h>

int main() {
    printf("Line 1 ");
    printf("Line 2");
    return 0;
}
 

Output:

Line 1 Line 2

Related questions

+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
asked May 22, 2023 in C Programming by kvdevika (178k points)

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...