int a = 10 + 10
....
,...
A = A * A
What would be the value of A?
The answer is 120!! Could anyone explain this to me.
Answers were Sorted based on User's Feedback
Answer / vinayak bhat
a=10*10
It s a macro concept,,very simple
a=a*a becomes
a=10+10*10+10
* has highest priority than +
hence expression becomes like
a=10+(10*10)+10
a=10+100+10
a=120
| Is This Answer Correct ? | 24 Yes | 6 No |
Answer / nagarajanselvaraj
In C everything is case sensitive
so variable with name 'a' differs from variable
with name 'A'
The given result is not possible
because 120 is not a square number.
| Is This Answer Correct ? | 21 Yes | 4 No |
Design an implement of the inputs functions for event mode
prog. to produce 1 2 3 4 5 6 7 8 9 10
Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number
int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
Finding a number which was log of base 2
how to return a multiple value from a function?
Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.
main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }
How can u say that a given point is in a triangle? 1. with the co-ordinates of the 3 vertices specified. 2. with only the co-ordinates of the top vertex given.
write a c program to Reverse a given string using string function and also without string function
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