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


# define x=1+4;
main()
{
int x;
printf("%d%d",x/2,x/4);
}

Answers were Sorted based on User's Feedback



# define x=1+4; main() { int x; printf("%d%d",x/2,x/4); }..

Answer / karthik

the preprocessor directive is not written correctly

so u r going to get CE
#define x 1+4
void main()
{
printf("%d%d",x/2,x/4);

}
will work fine and give output as 32

Is This Answer Correct ?    4 Yes 2 No

# define x=1+4; main() { int x; printf("%d%d",x/2,x/4); }..

Answer / rama krishna sidhartha

The preprocessor syntax is wrongly written. It should be as
follows :

#define x 1+4

void main()
{
printf("%d%d",x/2,x/4);
}

There is no need of declaring the variable 'x' in
between 'main()' function since it is already declared
in '#define' directive.

The output will be : 3 and 2

Is This Answer Correct ?    2 Yes 0 No

# define x=1+4; main() { int x; printf("%d%d",x/2,x/4); }..

Answer / banavathvishnu

x/2 will become 1+4/2=3
x/4 will become 1+4/4 = 2

Is This Answer Correct ?    3 Yes 2 No

# define x=1+4; main() { int x; printf("%d%d",x/2,x/4); }..

Answer / 123ghouse@gmail.com

3,2

Is This Answer Correct ?    2 Yes 2 No

# define x=1+4; main() { int x; printf("%d%d",x/2,x/4); }..

Answer / sumalatha

ans is 4 4

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

Find the largest number from the given 2 numbers without using any loops and the conditional operator.

2 Answers  


If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402

0 Answers  


the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above

0 Answers  


What are types of structure?

0 Answers  


Write a function that accepts a sentence as a parameter, and returns the same with each of its words reversed. The returned sentence should have 1 blank space between each pair of words. Demonstrate the usage of this function from a main program. Example: Parameter: “jack and jill went up a hill” Return Value: “kcaj dna llij tnew pu a llih”

5 Answers   Mind Tree,


plz answer.... write a program that reads line (using getline) e.g."345", converts each line to an integer using "atoi" and computes the average of all the numbers read. also compute the standard deviation.

1 Answers  


which of the following go out of the loopo if expn 2 becoming false a.while(expn 1){...if(expn 2)continue;} b.while(!expn 1){if(expn 2)continue;...} c.do{..if(expn 1)continue;..}while(expn 2); d.while(!expn 2){if(expn 1)continue;..}

4 Answers   TCS,


EXPLAIN #INCLUDE<STDIO.H> EXPLAIN #INCLUDE<CONIO.H>

4 Answers  


34.what are bitwise shift operators? 35.what are bit fields? What is the use of bit fields in a structure declaration? 36.what is the size of an integer variable? 37.what are the files which are automatically opened when a c file is executed? 38.what is the little endian and big endian? 39.what is the use of fflush() function? 40.what is the difference between exit() and _exit() functions? 41.where does malloc() function get the memory? 42.what is the difference between malloc() and calloc() function? 43.what is the difference between postfix and prefix unary increment operators?

3 Answers  


What is the difference between malloc() and calloc() function in c language?

0 Answers  


What is 02d in c?

0 Answers  


What is class and object in c?

0 Answers  


Categories