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

What is Your Name :)

1 Answers  


Why we use void main in c?

0 Answers  


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL

0 Answers  


main() { int i; for(i=0;i<5;i++) printf("%d",1l<<i); } why doesn't 'l' affect the code??????

1 Answers  


Write a C Program to display the following menu: Menu 1. Display 2. Copy 3. Append 4. Exit Accept the choice (1-4) from the user, and perform the following tasks: Choice 1: Accept a file name from the user and display the file on screen Choice 2: Accept two file names, and copy first file to the second Choice 3: Accept two file names, and append second file to the first file Choice 4: Terminate the program

1 Answers   Accenture, Concor, DMU, Satyam, Syntel, Tora,


what is void pointer?

2 Answers  


What is the default value of local and global variables in c?

0 Answers  


Differentiate between a structure and a union.

0 Answers   Zensar,


Is it better to use malloc() or calloc()?

0 Answers   Aspire, Infogain,


2.main { int x,j,k; j=k=6;x=2; x=j*k; printf("%d", x);

9 Answers   HCL, Tech Mahindra,


what is the format specifier for printing a pointer value?

0 Answers  


Explain what is wrong in this statement?

0 Answers  


Categories