what is the output of the code and how?

main()
{
int *ptr,x;
x=sizeof(ptr);
printf("%d",x);
}



what is the output of the code and how? main() { int *ptr,x; x=sizeof(ptr); printf("%d&q..

Answer / veluri.haritha

If a compiler is a 16 bit compiler and its memory model is
tiny or small or compact memory model then the "x" value
will be 2 bytes.

if the memory model is large or huge memory model then the
"x" value will be 4 bytes.

if a compiler is a 32 bit compiler then the also the x value
is 4 bytes
by
V.haritha,not yet joined in B.tech

Is This Answer Correct ?    13 Yes 0 No

Post New Answer

More C Interview Questions

for questions 14,15,16,17 use the following alternatives:a.int b.char.c.string.d.float

1 Answers  


Write a program to generate prime factors of a given integer?

2 Answers  


How to write in a function declaration and in function call in which the function has 'n' number of varible or arguments?

2 Answers  


hi , please send me NIC written test papers to sbabavalli@gmail.com

0 Answers   NIC,


What is the difference between the local variable and global variable in c?

0 Answers  






design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.

0 Answers   TCS,


Stimulate calculators to perform addition,subtraction,multiplication and division on two numbers using if/else statement?

1 Answers   IBM,


what are non standard function in c

0 Answers  


Write an interactive c program that will encode or decode a line of text. To encode a line of text, proceed as follows: Convert each character, including blank spaces, to its ASCII equivalent. Generate a positive random integer. Add this integer to the ASCII equivalent of each character. The same random integer will be used for the entire line of text. Suppose that N1 represents the lowest permissible value in the ASCII code, and N2 represents the highest permissible value. If the number obtained in step 2 above exceeds N2, then subtract the largest possible multiple of N2 from this number, and add the remainder to N1. Hence the encoded number will always fall between N1 and N2, and will therefore always represent some ASCII character. Display the characters that correspond to the encoded ASCII values. The procedure is reversed when decoding a line of text. Be certain, however, that the same random number is used in decoding as was used in encoding.

1 Answers   Amazon, CSJM, HCL, Microsoft, TCS, Wipro,


#define MAX 3 main() { printf("MAX = %d ",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif }

1 Answers  


Hai what is the different types of versions and their differences

0 Answers  


write a program to reverse the words in the sentence.NOTE:not reverse the entire string but just the occurance of each word

1 Answers   Sienna Ecad, Wipro,


Categories