小话C语言中的cotinue和break

#include
int fun()
{    printf("fun\n");   
 return 1;
}

int main(int argc,char *argv[])
{  
  int c=0;   
 printf("please input your num ,case 3 to break\n");    
do{        
 scanf("%d",&c);       
 switch(c){            
case 0:            
    break;  /*这里的break只会跳出swtich*/          
  case 1:              
  continue;  /*直接跳到while处判断*/            case 3:               
 printf("in case 3 going to break\n");              
  break;            
default:              
  break;      
  }       
 printf("inside while ,keep going!\n");   
 }while(fun());   
 printf("out of while finish\n");   
 return(0);
}

编译运行

gcc -o break break.c

./break

please input your num ,case 3 to brea

k(输入)1fun

(输入)2inside while ,keep going!fun

(输入)3

in case 3 going to breakinside while ,keep going!

fun

你可能感兴趣的:(语言,c,fun,input,gcc)