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...


main()

{

register int a=2;

printf("Address of a = %d",&a);

printf("Value of a = %d",a);

}

Answers were Sorted based on User's Feedback



main() { register int a=2; printf("Address of a = %d",&a); ..

Answer / susie

Answer :

Compier Error: '&' on register variable

Rule to Remember:

& (address of ) operator cannot be applied on register
variables.

Is This Answer Correct ?    3 Yes 1 No

main() { register int a=2; printf("Address of a = %d",&a); ..

Answer / chandra

It all depends on C/C++.

On C(GNU C/Visual studio C compiler), it will get a compiler
error.
since the keyword with register is stored in registers of
CPU rather than in memory locations of RAM.

On C++(GNU C++/Visual stdio C++ compiler), variable 'a' will
get an address of memory locations.
since register will automatically take address of memory

Is This Answer Correct ?    1 Yes 0 No

main() { register int a=2; printf("Address of a = %d",&a); ..

Answer / shrikantauti

Will produce an error as the memory address s not provided.
%u should had written instead of %d

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C Code Interview Questions

Sorting entire link list using selection sort and insertion sort and calculating their time complexity

1 Answers   Infosys, Microsoft, NetApp,


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

0 Answers   Honeywell,


int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too

1 Answers  


main() { unsigned int i=65000; while(i++!=0); printf("%d",i); }

1 Answers  


Write a C function to search a number in the given list of numbers. donot use printf and scanf

5 Answers   Honeywell, TCS,


char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }

2 Answers  


Write a routine that prints out a 2-D array in spiral order

3 Answers   Microsoft,


main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }

2 Answers   HP,


hello sir,is there any function in C that can calculate number of digits in an int type variable,suppose:int a=123; 3 digits in a.what ll b answer?

6 Answers  


program to Reverse a linked list

12 Answers   Aricent, Microsoft, Ness Technologies,


main() { static int var = 5; printf("%d ",var--); if(var) main(); }

1 Answers  


How do you write a program which produces its own source code as its output?

7 Answers  


Categories