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 ? | 16 Yes | 2 No |
Answer / mina
Compiler Error.
switch operates only with char and int.
| Is This Answer Correct ? | 3 Yes | 0 No |
how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns
#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }
4 Answers Google, HCL, Quick Heal, WTF,
main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }
main() { printf("%x",-1<<4); }
to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD
Which one is taking more time and why ? :/home/amaresh/Testing# cat time.c //#include <stdio.h> #define EOF -1 int main() { register int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } ------------------- WIth stdio.h:- :/home/amaresh/Testing# time ./time_header hi hi hru? hru? real 0 m4.202s user 0 m0.000s sys 0 m0.004s ------------------ Witout stdio.h and with #define EOF -1 =================== /home/amaresh/Testing# time ./time_EOF hi hi hru? hru? real 0 m4.805s user 0 m0.004s sys 0 m0.004s -- From above two case , why 2nd case is taking more time ?
Sir... please give some important coding questions asked by product companies..
main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); } int i;
Extend the sutherland-hodgman clipping algorithm to clip three-dimensional planes against a regular paralleiepiped
1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.
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"
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }