main()
{
int i =10, j = 20;
clrscr();
printf("%d, %d, ", j-- , --i);
printf("%d, %d ", j++ , ++i);
}
a. 20, 10, 20, 10
b. 20, 9, 20, 10
c. 20, 9, 19, 10
d. 19, 9, 20, 10
Answers were Sorted based on User's Feedback
Answer / ramya
for right increment the value not change.
for the left increment the value change.
so j++=20,--i=9,j++=20,++i=10.
| Is This Answer Correct ? | 0 Yes | 1 No |
void main() { int i=i++,j=j++,k=k++; printf(“%d%d%d”,i,j,k); }
how to delete an element in an array
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
main() { signed int bit=512, mBit; { mBit = ~bit; bit = bit & ~bit ; printf("%d %d", bit, mBit); } } a. 0, 0 b. 0, 513 c. 512, 0 d. 0, -513
3 Answers HCL, Logical Computers,
#include<stdio.h> int main() { int x=2,y; y=++x*x++*++x; printf("%d",y); } Output for this program is 64. can you explain how this output is come??
main() { char a[4]="HELL"; printf("%s",a); }
How to read a directory in a C program?
1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.
main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } a. Runtime error. b. 0, 0 c. Compile error d. the first two values entered by the user
void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }
Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.
main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }