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

Explain why C language is procedural?

0 Answers   GE,


What is function what are the types of function?

0 Answers  


5) Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.without using big int and exponential function

1 Answers   TCS,


what is the difference between const volatile int i & volatile const int j;

2 Answers   HCL,


Program to simulate second clock

2 Answers  


Write a program to reverse a linked list in c.

0 Answers   DELL, HAL,


What is difference between structure and union?

0 Answers  


how is the examination pattern?

0 Answers   Wipro,


Where is c used?

0 Answers  


21. #define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

3 Answers  


Explain the use of fflush() function?

0 Answers  


how the size of an integer is decided? - is it based on processor or compiler or OS?

19 Answers   HCL, JPR, Microsoft, nvidia,


Categories