# define x=1+4;
main()
{
int x;
printf("%d%d",x/2,x/4);
}
Answer Posted / 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 |
Post New Answer View All Answers
Why c is a procedural language?
Is there a way to jump out of a function or functions?
I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
What is the difference between abs() and fabs() functions?
i want to switch my career from quailty assurance engineering to development kindly guide me from which programming language its better for me to start plz refer some courses or certifications too i have an experience of 1.5 yrs in QA field.Kindly guide me
How will you divide two numbers in a MACRO?
What are the salient features of c languages?
Why doesn't C support function overloading?
Explain how does free() know explain how much memory to release?
Place the #include statement must be written in the program?
How many keywords (reserve words) are in c?
Does c have circular shift operators?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80
What are structure types in C?