条件控制if else
if ( a>b )
max=a;
else
max=b;
分支控制switch case
switch( ch )
{
case 'Y':
case 'y':
printf("continue!\n");
break;
default:
printf("quit!\n");
}
循环控制for while do-while
for( i=0;i<10;i++)
{
printf("%4d",i );
}
i=0;
while ( i<10 )
{
printf("%4d",i );
i++;
}
char ch;
do
{
printf("input your choice(Y/N):");
ch=getchar();
}while(ch!='Y' && ch !='N' );