main()
{
float i=1.5;
switch(i)
{
case 1: printf("1");
case 2: printf("2");
default : printf("0");
}
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
Compiler Error: switch expression not integral
Explanation:
Switch statements can be applied only to integral types.
Is This Answer Correct ? | 15 Yes | 2 No |
Answer / mina
Compiler Error.
switch operates only with char and int.
Is This Answer Correct ? | 3 Yes | 0 No |
#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }
4 Answers Google, HCL, Quick Heal, WTF,
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
Write a program to receive an integer and find it's octal equivalent. How can i do with using while loop.
void main() { int i=5; printf("%d",i++ + ++i); }
main() { int i =0;j=0; if(i && j++) printf("%d..%d",i++,j); printf("%d..%d,i,j); }
#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer
int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf("%d\n",i)) printf("%d--",t--); } // If the inputs are 0,1,2,3 find the o/p
Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)
write a c program to Create a mail account by taking the username, password, confirm password, secret_question, secret_answer and phone number. Allow users to register, login and reset password(based on secret question). Display the user accounts and their details .
main() { int a[10]; printf("%d",*a+1-*a+3); }