main()
{
char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
Behavior is implementation dependent.
Explanation:
The detail if the char is signed/unsigned by default
is implementation dependent. If the implementation treats
the char to be signed by default the program will print –128
and terminate. On the other hand if it considers char to be
unsigned by default, it goes to infinite loop.
Rule:
You can write programs that have implementation
dependent behavior. But dont write programs that depend on
such behavior.
Is This Answer Correct ? | 5 Yes | 2 No |
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
could you please send the program code for multiplying sparse matrix in c????
String reverse with time complexity of n/2 with out using temporary variable.
write a simple calculator c program to perform addition, subtraction, mul and div.
0 Answers United Healthcare, Virtusa,
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }
main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000
code of a program in c language that ask a number and print its decremented and incremented number.. sample output: input number : 3 321123
struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above
main() { char not; not=!2; printf("%d",not); }
char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)
void pascal f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } void cdecl f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } main() { int i=10; f(i++,i++,i++); printf(" %d\n",i); i=10; f(i++,i++,i++); printf(" %d",i); }
Write a program using one dimensional array to assign values and then display it on the screen. Use the formula a[i]=i*10 to assign value to an element.
1 Answers Samar State University,