# 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
What is malloc() function?
How are structure passing and returning implemented?
How can I find out the size of a file, prior to reading it in?
What is the use of parallelize in spark?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
What is a double c?
What is the purpose of void in c?
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
How can I remove the leading spaces from a string?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
Compare array data type to pointer data type
What is string function c?
How can you invoke another program from within a C program?
What is sizeof array?
What is the difference between c and python?