Update c.html.markdown

This commit is contained in:
himanshu81494 2015-10-08 15:31:40 +05:30
parent 626ee03fc3
commit e8248af134

View File

@ -308,6 +308,24 @@ int main(void) {
break; break;
} }
// using "goto"
typedef enum { false, true } bool;
// for C don't have bool as data type :(
bool disaster = false;
int i, j;
for(i=0;i<100;++i)
for(j=0;j<100;++j)
{
if((i + j) >= 150)
disaster = true;
if(disaster)
goto error;
}
error :
printf("Error occured at i = %d & j = %d.\n", i, j);
// this will print out "Error occured at i = 52 & j = 99."
/////////////////////////////////////// ///////////////////////////////////////
// Typecasting // Typecasting
/////////////////////////////////////// ///////////////////////////////////////