# 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 what are compound statements?

0 Answers  


Can u please send me the exam pattern and also Previous papers to javed123go@gmail.com

0 Answers  


I have a varargs function which accepts a float parameter?

0 Answers  


In C programming, how do you insert quote characters (‘ and “) into the output screen?

0 Answers  


What is an anonymous union and where to apply that ?

3 Answers   HP,






to write a program, that finds the minimum total number of shelves, including the initial one, required for this loading process. The packets are named A, B, C, D, E …….. Any numbers of packets with these names could be kept in the shelf, as in this example: [ZZLLAAJKRDFDDUUGGYFYYKK]. All packets are to be loaded on cars. The cars are lined in order, so that the packets could be loaded on them. The cars are also named [A, B, C, D, E,………….].

2 Answers   Infosys, TCS,


write a c program to find largest number in matrix(in each row,each column, diagonally, and in the whole matrix)? Its urgent.

2 Answers  


Difference between MAC vs. IP Addressing

0 Answers  


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

0 Answers  


What is context in c?

0 Answers  


Write a program to implement queue.

0 Answers   Aricent,


How do we print only part of a string in c?

0 Answers  


Categories