int i,j;
for(i=0;i<=10;i++)
{
j+=5;
assert(i<5);
}
Answers were Sorted based on User's Feedback
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 |
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=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }
struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }
#ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }
struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); } a. Your Name b. compile error c. Name d. Runtime error
respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility"
main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
write a c-program to find gcd using recursive functions
char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }
main() { clrscr(); } clrscr();