Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



int a = 10 + 10 .... ,... A = A * A What would be the value of A? The answer is 120!! Could ..

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

int a = 10 + 10 .... ,... A = A * A What would be the value of A? The answer is 120!! Could ..

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

Post New Answer

More C Code Interview Questions

Design an implement of the inputs functions for event mode

0 Answers   Wipro,


prog. to produce 1 2 3 4 5 6 7 8 9 10

4 Answers   TCS,


Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number

2 Answers   Ace Info,


int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }

3 Answers   Cisco, HCL,


#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

1 Answers  


Finding a number which was log of base 2

1 Answers   NetApp,


how to return a multiple value from a function?

2 Answers   Wipro,


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.

5 Answers   Amazon, Microsoft,


main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }

1 Answers  


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.

1 Answers  


write a c program to Reverse a given string using string function and also without string function

1 Answers  


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

3 Answers   HCL,


Categories