C ако още

Примерен код

8
0

оператор if в c

#include <studio.h>
int main()
{
  if (logic goes here)
  {
    CODE
  }
  else if (logic)
  {
    CODE
  }
  else{
    CODE
  }
  return 0
}
7
0

c ако още

if (<condition>) {
	<code>
} else if (<condition>) {
	<code>
} else {
	<code>
}

/* example */
int money = 50;
if (money < 15) {
	go_home();
} else if (money >= 600) {
	buy_all();
} else {
	buy_tickets(money / 15);
}

/* You can chain together as many else ifs as you want. But if there are
too many it will make the code hard to understand. In that case I would 
recommend trying other solutions. */
0
0

C пример, ако още

if (test expression1) {
   // statement(s)
}
else if(test expression2) {
   // statement(s)
}
else if (test expression3) {
   // statement(s)
}
.
.
else {
   // statement(s)
}

Подобни страници

Подобни страници с примери

На други езици

Тази страница на други езици

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Íslensk
..................................................................................................................