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 ?    1 Yes 0 No

Post New Answer

More C Code Interview Questions

typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }

1 Answers  


how can u draw a rectangle in C

53 Answers   Accenture, CO, Codeblocks, Cognizant, HCL, Oracle, Punjab National Bank, SAP Labs, TCS, University, Wipro,


Write a program to receive an integer and find its octal equivalent?

7 Answers  


const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above

1 Answers   emc2, HCL,


How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,






what is oop?

3 Answers  


int aaa() {printf(“Hi”);} int bbb(){printf(“hello”);} iny ccc(){printf(“bye”);} main() { int ( * ptr[3]) (); ptr[0] = aaa; ptr[1] = bbb; ptr[2] =ccc; ptr[2](); }

1 Answers  


Printf can be implemented by using __________ list.

3 Answers  


how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!

8 Answers   GATE,


How to return multiple values from a function?

7 Answers  


main() { char not; not=!2; printf("%d",not); }

1 Answers  


main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?

2 Answers  


Categories