User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







c:control_structures:else

else

#include <stdio.h> /* including standard library */
//#include <windows.h> /* uncomment this for Windows */
 
    if ( condition == true ){
    command;    
    } else {
       command;
    }

C Sourcecode Example

#include <stdio.h> /* including standard library */
//#include <windows.h> /* uncomment this for Windows */
 
 
int main( void )
{
  int i;
 
  for (i=0;i<=99;i++){
    if (i==42) {
        printf("I have found the answer: %i\n",i);
    } else {
           printf("found any other answer\n");
           }
}
 
return 0;
}
  output of else
  
  found any other answer
  found any other answer
  I have found a answer: 42

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
c/control_structures/else.txt · Last modified: 2024/02/16 01:04 (external edit)

Impressum Datenschutz