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 Language Program to Find Sum and Average of 3 Numbers

                                  C Language Program to Find Sum and Average of 3 Numbers



 C Program find Sum and Average of the Three Number
Examples :-    


#include<stdio.h>

void main()
{
int a,b,c,s,v;
printf("Enter First Number:");

scanf("%d",&a);
printf("Enter Second Number:");

scanf("%d",&b);
printf("Enter Third Number:");

scanf("%d",&c);

s=a+b+c;

printf("sum of given Numbers is %d\n",s);

v=s/3;
printf("Average of given Number is %d",v);

}

C Language Program to Find Sum and Average of 3 Numbers

Explain Program

Step :1

#include<stdio.h>

  •  use functions like printf() and scanf().
Step :2

void main()

  • Defines the main function
Step :3

int a, b, c, s, v;

  1. a, b, c: To store the three input numbers.
  1. s: To store the sum of the numbers.
  1. v: To store the average of the numbers.

Step :4

printf ("Enter First Number");

  • Displays a message  user to enter the first number.

Step :5

scanf("%d", &a);

  1.  input to the user and stores it in variable a.
  2. %d  specifies that the inputs is an integer.
  3. & a is the address of variable a

Step :6

s = a + b + c;

  • Add the three integer and stores the result in s.

Step :7

printf ("Sum of given Number  %d\n", s);

  • Prints the calculated sum using %d 

Step :8

v =  s / 3;

Divides the sum by 3 to find the average.

Step :9

printf("Average of given Numbers is %d", v);

  • Prints the calculated average.

C Program find Sum and Average of the Three Number

 Program Output 

C Program find Sum and Average of the Three Number


Related Post :-

javascript logical operator
php program to print alphabet pattern l
Css padding property

Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

HTML Input Type Submit Syntax and Example