answersLogoWhite

0


Best Answer

An example might help:

if (exp) if (exp2) stmt2 else stmt3

equvalent with this:

if (exp) { if (exp2) stmt2 else stmt 3 }

if that's not what you want, use {braces}:

if (exp) { if (exp2) stmt2 } else stmt3

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is it true in programming c the last else is associated with nearest if?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

C code for linear programming problem?

#include<stdio.h> #include<conio.h> #include<string.h> void main() { int first,last,flag=1; char str[100]; clrscr(); printf("Enter number to get to check wheather palindrome or not"); gets(str); first=0; last=strlen(str)-1; printf("%d",first); printf("%d",last); while(first<=last) { if(str[first]!=str[last]) flag=0; first++; last--; } if(flag==1) { clrscr(); printf("this is palindrome"); getch(); } else { clrscr(); printf("sorry this is not a palindrome"); getch(); } }


What is the meaning of popping in computer programming?

Popping is the opposite of pushing. You push values into a queue and pop them off. The queue is generally represented by a stack, where the last value pushed onto the stack is the first to be popped off the stack (last in first out, or LIFO).


Write down the algorithm to delete a node from doubly linked list whose data item is given?

1. Find the element is the list. Let pointer 'p' point to it. 2. Delete it from the list: if (p->Prev) p->Prev->Next = p->Next; else List->First = p->Next; if (p->Next) p->Next->Prev = p->Prev; else List->Last = p->Prev; 3. Release the memory associated with it.


What is handsome number in c programming?

Handsome numbers are the numbers in which the sum of all the left side numbers is equal to the last number for example 123 - 1+2=3 its a handsome number


What is the difference between a readline statement and a writeline statement?

The readline statement method of programming will allow for the next statement in the sequence to be read. The writeline method of programming only allows for the current statement or sequence to be read after determining the end of the last line.

Related questions

Who was associated with temperature?

Kelvin, Celsius, and Fahrenheit are the last names of the people who are associated with temperature.


Do you round from the last number if you round to the nearest hundredth?

The nearest hundredth is the same as two decimal places.


how do i round 3421 to the nearest hundred?

3400 We round the number up to the nearest hundred if the last two digits in the number are 50 or above. We round the number down to the nearest hundred if the last two digits in the number are 49 or below. If the last two digits are 00, then we do not have to do any rounding, because it is already to the hundred.


How do you round 321 to nearest hundred?

Remember, we did not necessarily round up or down, but to the hundred that is nearest to 321. First, 321 rounded to the nearest hundred is: 300 When rounding to the nearest hundred, like we did with 321 above, we use the following rules: A) We round the number up to the nearest hundred if the last two digits in the number are 50 or above. B) We round the number down to the nearest hundred if the last two digits in the number are 49 or below. C) If the last two digits are 00, then we do not have to do any rounding, because it is already to the hundred.


What is the conflict of the last butterfly?

There are quite a few conflicts associated with the last butterfly. The last butterfly for example cannot reproduce with another.


What is the nationality of the last name Hebert?

The last name Hebert is commonly associated with French nationality.


how do i round 850 to the nearest hundred?

900 When rounding to the nearest hundred, like we did with 850 above, we use the following rules: A) We round the number up to the nearest hundred if the last two digits in the number are 50 or above. B) We round the number down to the nearest hundred if the last two digits in the number are 49 or below. C) If the last two digits are 00, then we do not have to do any rounding, because it is already to the hundred.


Can someone else sign your last will and testement?

No.


How do you round 54.6877 to the nearest thousandths?

Because the last 7 is larger than 5 and is a ten-thousandth, it is rounded to the nearest thousandth as 54.688


How do you round 113.04 to the nearest unit?

113.04 rounded to the nearest unit is 113. Take the last digit of the WHOLE number, in this case, the 3.


Round 691 to the nearest ten?

Rounded to the nearest ten, 691 becomes 690 as the last number is less than five.


8,398to the nearest hundred?

A) We round the number up to the nearest hundred if the last two digits in the number are 50 or above. 8400 is the answer