‎#define good bad
main()
{
int good=1;
int bad=0;
printf ("good is:%d",good);
}
Answers were Sorted based on User's Feedback
Answer / suresh kumar beniwal
multiple declaration of bad
so error occur
write program is
#define good bad
main()
{
int good=1;
bad=0;
printf ("good is:%d",good);
}
output :
good is : 0
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / elango
ans:0
Explain:
#define good bad
is denoted by good = bad,
printf("good is:%d",good);
ans"0
| Is This Answer Correct ? | 1 Yes | 0 No |
Give a oneline C expression to test whether a number is a power of 2?
25 Answers EA Electronic Arts, Google, Motorola,
void main() { int c; c=printf("Hello world"); printf("\n%d",c); }
void main() { int *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf(“%d”,*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf(“%d”,*cptr); }
How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)
Sir... please give some important coding questions asked by product companies..
#include<stdio.h> #include<conio.h> void main() { int a=(1,2,3,(1,2,3,4); switch(a) { printf("ans:"); case 1: printf("1");break; case 2: printf("2");break; case 3: printf("1");break; case 4: printf("4");break; printf("end"); } getch(); }
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }
Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.
2 Answers Mentor Graphics, Microsoft,
Display the time of the system and display the right time of the other country
create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"
main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };