Conditional Rendering in React Complete Guide with Examples 2026

Image
  Conditional Rendering in React Conditional Rendering is one of the most useful concepts in React. It means showing different content on the screen depending on a condition. For example: If a user is logged in → show Logout If a user is not logged in → show Login If a student has passed → show Congratulations If a product is available → show Buy Now If data is loading → show Loading... React does not have a separate if rendering tag. Instead, we use normal JavaScript conditions such as if, the ternary operator, &&, and switch to decide what should appear in the UI.

C Program to Display a Star Square Pattern


"C Program to Display a Star Square Pattern


 C Program to Display a Star Square Pattern

Example 


#include<stdio.h>
int main()
{
int row,j,nacr();
for(row=1;row<=10 ;row++)
{
for(j=1;j<=15;j++)
{
printf("*");
}
printf("\n");
}
getch();
}


C Program to Display a Star Square Pattern
Explain Program

Step :1

#include<stdio.h>

  •  Standard Input Output library.

Step :2

int main()

  • Entry point of the C program.

Step :3

int row, j, nacr();

  • This line declares:
  • int row:-> used as outer loop counter.
  • int j:-> used as inner loop counter.
  • nacr(); -> this  function named nacr that returns int and takes unknown parameters.

Step :4

for(row = 1; row <= 10; row++)

  • Outer loop that runs from row = 1 to 10.
  • Controls how many lines will be printed.

Step :5

for(j = 1; j <= 15; j++)

  • Inner loop that prints asterisks on each line.
Step :6

printf("*");

  • Prints one asterisk without a newline.

Step :7

printf("\n");

  • After printing 15 stars, this moves the cursor to the next line.

Step :8

getch();

C Program to Display a Star Square Pattern

 Program Output :-

C Program  Print  Square Star Pattern

Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

HTML Input Type Submit Syntax and Example