Site menu

CodeCook.io

  • Languages
    • C
    • C++
    • CSS
    • Git
    • HTML
    • Java
    • JavaScript
    • jQuery
    • PHP
    • Python
    • Ruby
    • Scala
  • conditional
  • switch

C - Switch

Execute different code section depending on value of expression.

0
626
  • Share on Facebook
  • Share on Google+
  • Share on Twitter

Switch

switch({{expression}}) {
  case {{test1}}:
    {{code1}}
    break;
  case {{test2}}:
    {{code2}}
    break;
  default:
    {{other_code}}
}
c

Notes

last update: Oct. 28, 2014

Advertisement

This project is hosted on DigitalOcean, try it and support us

Other language

  • C++
  • Java
  • Scala
  • Python
  • JavaScript

Random task

  • Get specific element from list of Protractor returned elements for locator
  • Change user
  • Append item to array
  • Test whether AngularJS element is visible in Jasmine test
  • Add file to repository
  • Blog
  • About
  • License