nested if Statement
เคจेเคธ्เคेเคก if เคธ्เคेเคเคฎेंเค เคธी เคช्เคฐोเค्เคฐाเคฎिंเค เคฎे เคिเคธी if statement เคฏा if else เคธ्เคेเคเคฎेंเค เคे เค
ंเคฆเคฐ
เคฆूเคธเคฐे if เคธ्เคेเคเคฎेंเค เคฏा if else เคธ्เคेเคเคฎेंเค เคे เคช्เคฐเคฏोเค เคो เค
เคจुเคฎเคคि เคช्เคฐเคฆाเคจ เคเคฐเคคा เคนैं। เคैเคธे
if (condition)
{
If (condition)
{
Statement 1 ;
Statement 2 ;
}
}
เคैเคธा เคी เคเคช เคเคชเคฐ เคฆिเคฏे
เคนुเคฏे เคธिंเคैเค्เคธ เคो เคฆेเค เคธเคเคคे เคนैं, เคी
เคเค if เคธ्เคेเคเคฎेंเค เคे เค
ंเคฆเคฐ เคฆूเคธเคฐा if เคธ्เคेเคเคฎेंเค
เคा เคเคชเคฏोเค เคिเคฏा เคเคฏा เคนैं। เคเคธ เคช्เคฐเคाเคฐ เคे if เคธ्เคेเคเคฎेंเค เคो เคจेเคธ्เคेเคก
if เคธ्เคेเคเคฎेंเค เคเคนเคคे เคนैं।
เคเคธเคा เคเคชเคฏोเค เคเคฌ เคिเคฏा
เคाเคคा เคนैं เคเคฌ เคเคช เคเค เคถเคฐ्เคค (condition) เคे เคธเคนी เคนोเคจे เคे
เคฌाเคฆ เคฆूเคธเคฐे เคंเคกीเคถเคจ เคो เคाँเคเคจा เคाเคนเคคे เคนैं।
* Find largest among 3 variables using
nested if */
#include
int main()
{
int a,b,c;
printf("Enter 3 numbers: \n");
scanf("%d %d %d",&a,&b,&c);
if(a>=b)
{
if(a>=c)
printf("%d is largest",a);
else
printf("%d is largest",c);
}
else { if(b>=c)
printf("%d is largest",b);
else
printf("%d is largest",c);
#include
int main()
{
int a,b,c;
printf("Enter 3 numbers: \n");
scanf("%d %d %d",&a,&b,&c);
if(a>=b)
{
if(a>=c)
printf("%d is largest",a);
else
printf("%d is largest",c);
}
else
printf("%d is largest",b);
else
printf("%d is largest",c);
}
return 0;
}
return 0;
}
เคฏเคน เคเค เคช्เคฐोเค्เคฐाเคฎ เคนैं เคिเคธเคฎे 3 เคตेเคฐिเคเคฌเคฒ เคฎे เคธเคฌเคธे
เคฌเฅे เคตेเคฐिเคฏเคฌเคฒ เคो เคชเคคा เคเคฐเคจा เคนै, เคเคธเคฎे
เคเคช เคฆेเค เคธเคเคคे เคนैं เคी nested if เคा เคเคธ्เคคेเคฎाเคฒ เคिเคฏा เคเคฏा เคนैं।
เคเคธ เคช्เคฐोเค्เคฐाเคฎ เคฎे เคธเคฌเคธे
เคชเคนเคฒे เคตाเคฒे if เคฎे a>b เคो เคांเคा เคा เคฐเคนा เคนैं, เค
เคเคฐ เคถเคฐ्เคค เคธเคนी เคนुเค เคคो a>c เคो เคांเคा เคाเคเคा। เค
เคเคฐ เคชเคนเคฒी เคถเคฐ्เคค เคเคฒเคค เคนो เคाเคคी เคคो เคฆूเคธเคฐी เคถเคฐ्เคค เคो เคจเคนीं เคांเคा เคाเคเคा, เคฌเคฒ्เคि เคช्เคฐोเค्เคฐाเคฎ เคा เคंเค्เคฐोเคฒ เคชเคนเคฒे if เคे else เคो เคชाเคธ เคนो เคाเคเคा। เค
เคฌ เคเคช เคฆेเคेंเคे เคी เคเคธ else เคे เค
ंเคฆเคฐ
เคญी เคเค if else stetment เคช्เคฐเคฏोเค เคिเคฏा เคเคฏा เคนैं। เคिเคธเคฎे b >= c เคांเคा เคा เคฐเคนा เคนैं। เคคो เคเคช เคเคธ เคช्เคฐोเค्เคฐाเคฎ เคฎे เคจेเคธ्เคेเคก
if stetment เคा เคช्เคฐเคฏोเค เคฆेเค เคธเคฎเค เคเค เคนोंเคे
เคी เคจेเคธ्เคेเคก if statement เคเค if เคฏा else เคฌॉเคกी เคे เค
ंเคฆเคฐ เคเคชเคฏोเค เคฆूเคธเคฐे if เคฏा if else เคธ्เคेเคเคฎेंเค เคे เคช्เคฐเคฏोเค
เคो เคเคนเคคे เคนैं।
เค
เคฌ เคจेเคธ्เคेเคก if เคो เคธเคฎเคเคจे เคे เคฒिเค เคจीเคे เคเค เคिเคค्เคฐ เคฆिเคฏा เคा เคฐเคนा เคนैं เคเคธे เคฆेเค เคจेเคธ्เคेเคก
if stetment เคो เคธเคฎเคเคจे เคा เคช्เคฐเคฏाเคธ เคเคฐे।