C Program to Demonstrate Printf inside Another Printf Statement

In this tutorial you will learn about the C Program to Demonstrate Printf inside Another Printf Statement and its application with practical example.

C Program to Demonstrate Printf inside Another Printf Statement

In this tutorial, we will learn to create a C program that will Demonstrate Printf inside Another Printf Statement using C programming.

Prerequisites

Before starting with this tutorial we assume that you are best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.

Demonstrate Printf inside Another Printf Statement :-

As we all know every programming language the program cannot be completed without taking input or returning output.  In C programming language printf() and scanf() functions are inbuilt library functions in  which are available in C library by default. These functions are declared and related macros are defined in “stdio.h” which is a header file in C language.

We only have to include the header file named as “stdio.h” as shown in below C program to make use of these printf() and scanf() library functions in C language.

Printf function is used to write the output or show message on the screen.

In nested printf Inner most printf() function writes the output of the program.

Second printf() function counts the output number’s digits and write them.

And third printf() function will write the number of digits returned by the second printf() function

 

Algorithm:-

Program:-

Demonstrate Printf inside Another Printf Statement.

 

 

Output:-

The above program we have to first initialize the required variable.

  • no = it will hold the integer value.

Taking Input from the user an integer value.

Printing using Printf inside Another Printf Statement.

 

In this tutorial we have learn about the C Program to Demonstrate Printf inside Another Printf Statement and its application with practical example. I hope you will like this tutorial.