int i,j;

for(i=0;i<=10;i++)

{

j+=5;

assert(i<5);

}

Answers were Sorted based on User's Feedback



int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }..

Answer / susie

Answer :

Runtime error: Abnormal program termination.

assert failed (i<5), <file name>,<line number>

Explanation:

asserts are used during debugging to make sure that certain
conditions are satisfied. If assertion fails, the program
will terminate reporting the same. After debugging use,

#undef NDEBUG

and this will disable all the assertions from the
source code. Assertion

is a good debugging tool to make use of.

Is This Answer Correct ?    13 Yes 2 No

int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }..

Answer / cmonkey

j has not been initialized, so j could hold any garbage.
Depending upon what was in j, assertion could pass or fail.

Is This Answer Correct ?    3 Yes 0 No

int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }..

Answer / guest

error

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Code Interview Questions

Print an integer using only putchar. Try doing it without using extra storage.

2 Answers  


Is the following code legal? struct a { int x; struct a b; }

1 Answers  


plz send me all data structure related programs

2 Answers  


main() { int c=- -2; printf("c=%d",c); }

1 Answers   TCS,


main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

2 Answers  






There is a lucky draw held every day. if there is a winning number eg 1876,then all possible numbers like 1867,1687,1768 etc are the numbers that match irrespective of the position of the digit. Thus all these numbers qualify fr the lucky draw prize Assume there is no zero digit in any numbers. write a program to show all the possible winning numbers if a "winning number"is passed as an arguments to the function.

1 Answers   Nagarro,


#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); }

3 Answers   Hexaware,


What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

1 Answers  


write a program for area of circumference of shapes

0 Answers  


What is data _null_? ,Explain with code when u need to use it in data step programming ?

0 Answers   Abbott,


main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above

3 Answers   HCL,


To reverse an entire text file into another text file.... get d file names in cmd line

0 Answers   Subex,


Categories