# Switch statement from C

**URL:** <https://community.freefem.org/t/switch-statement-from-c/2005>\
**Category:** General Discussion\
**Created:** [September 14, 2022, 12:37pm UTC](https://community.freefem.org/t/switch-statement-from-c/2005 "2022-09-14T12:37:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![miguelpicos](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@miguelpicos](https://community.freefem.org/u/miguelpicos)\
**Post date:** [September 14, 2022, 12:37pm UTC](https://community.freefem.org/t/switch-statement-from-c/2005/1 "2022-09-14T12:37:19Z")

</div>

I would like to use the switch-case statement in a FreeFEM code. As it is based on C I supose that I should be able to use it, but the compiler does not recognize the sintax. ¿Is this sintax not suported by FreeFEM? ¿Is there any function implemented in FreeFEM to do a similiar job?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [September 14, 2022, 1:48pm UTC](https://community.freefem.org/t/switch-statement-from-c/2005/2 "2022-09-14T13:48:12Z")

</div>

It’s not possible, you have to use `if () { } else if () { } else { }` instead, with as many `else if` as you’d like.
