answersLogoWhite

0


Best Answer

if-else implies a first statement, while else-if implies that we would know what else is but we don't because else is defined by if.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between if-else and else-if?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you convert a roman numeral into decimal using matlab?

x=input('Enter the roman numeral: ','s'); l=length(x); for(i=1:l) if(x(i)=='I') a(i)=1; elseif(x(i)=='V') a(i)=5; elseif(x(i)=='X') a(i)=10; elseif(x(i)=='L') a(i)=50; elseif(x(i)=='C') a(i)=100; elseif(x(i)=='D') a(i)=500; elseif(x(i)=='M') a(i)=1000; else disp('Not a valid entry'); end end d=a(l); for(i=l:-1:2) if(a(i)>a(i-1)) d=d-a(i-1); elseif(a(i)==a(i-1) a(i)<a(i-1)) d=d+a(i-1); end end disp('The decimal equivalent is: '); disp(d);


Is there a limit to nesting elseif statements in PHP?

You can recursively nest as many if / elseif statement groups as you'd like, provided there is enough room to store the PHP file on a computer.


Advantages of logical operators over relational operators using If Then ElseIf statement?

you are a full time wanker.


What is difference between as on and as at?

difference between as on and as at


What are the differences between California and Florida?

What is the difference between Florida and California What is the difference between Florida and California


What is the difference between physician and doctor?

what's the difference between physician and doctorwhat's the difference between physician and doctor what's the difference between physician and doctor


What difference between paging?

Difference between paging and what?


Does anyone have a code for a VB donut Shoppe project?

Private Sub ClearLabels() ' clears the contents from the labels that display subtotal, tax, and total due lblSubtotal.Text = String.Empty lblSalesTax.Text = String.Empty lblTotal.Text = String.Empty End Sub Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click ' displays the cost of doughnuts and coffee Dim decSubtotal As Decimal Dim decSalesTax As Decimal Dim decTaxRate As Decimal = 0.03 Dim decTotal As Decimal 'calculates the cost of doughnuts If radGlazed.Checked Then decSubtotal += 0.65 ElseIf radSugar.Checked Then decSubtotal += 0.65 ElseIf radChocolate.Checked Then decSubtotal += 0.85 ElseIf radFilled.Checked Then decSubtotal += 1.0 End If ' calculates the cost of coffee If radNone.Checked = True Then ' do nothing ElseIf radRegular.Checked = True Then decSubtotal += 1.8 ElseIf radCappuccino.Checked = True Then decSubtotal += 2.5 End If ' calculate the sales tax decSalesTax = decTaxRate * decSubtotal ' calculates the price of a doughnut and coffee lblSubtotal.Text = decSubtotal.ToString("C2") lblSalesTax.Text = decSalesTax.ToString("C2") lblTotal.Text = decTotal.ToString("C2") End Sub


What is the difference between an enterprise and association what is the difference between an pvt ltd and ltd.?

difference between enterprise and corporation


What is the difference between an enterprise and association what is the difference between an pvt ltd and ltd?

difference between enterprise and corporation


What is the difference between a samurai and shogun?

The difference between a shogun and a samurai is like the difference between a king and a knight.


What is the difference between difference and difference?

just difference