Print the given pattern in C
printf() - Question 5
In this question, we will see how we can print the given pattern in C programming using the printf() function. To know more about printf() function click on the printf() function lesson.
Q5) Write a program in C to print the given pattern using printf() function on the screen.
5
45
345
2345
12345
Program
#include <stdio.h>
#include <conio.h>
int main()
{
printf("5\n");
printf("45\n");
printf("345\n");
printf("2345\n");
printf("12345");
return 0;
}
Output
5 45 345 2345 12345