What is the subtle error in the following code segment?
void fun(int n, int arr[])
{
int *p=0;
int i=0;
while(i++<n)
p = &arr[i];
*p = 0;
}
Answer / susie
Answer : & Explanation:
If the body of the loop never executes p is assigned no
address. So p remains NULL where *p =0 may result in problem
(may rise to runtime error “NULL pointer assignment” and
terminate the program).
| Is This Answer Correct ? | 1 Yes | 0 No |
posted by surbhi just now main() { float a = 5.375; char *p; int i; p=(char*)&a; for(i=0;i<=3;i++) printf("%02x",(unsigned char) p[i]); } how is the output of this program is :: 0000ac40 please let me know y this output has come
void ( * abc( int, void ( *def) () ) ) ();
main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; } a. Runtime error. b. Runtime error. Access violation. c. Compile error. Illegal syntax d. None of the above
x=2 y=3 z=2 x++ + y++; printf("%d%d" x,y);
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']
Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).
13 Answers Intel, Microsoft, TCS,
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
void main() { int i=5; printf("%d",i+++++i); }
why nlogn is the lower limit of any sort algorithm?
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }
Develop a routine to reflect an object about an arbitrarily selected plane