#include<stdio.h>
main()
{
int i=1,j=2;
switch(i)
{
case 1: printf("GOOD");
break;
case j: printf("BAD");
break;
}
}
Answer / susie
Answer :
Compiler Error: Constant expression required in
function main.
Explanation:
The case statement can have only constant expressions (this
implies that we cannot use variable names directly so an error).
Note:
Enumerated types can be used in case statements.
| Is This Answer Correct ? | 3 Yes | 0 No |
main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }
What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }
Write a single line c expression to delete a,b,c from aabbcc
What is the main difference between STRUCTURE and UNION?
void ( * abc( int, void ( *def) () ) ) ();
1) int i=5; j=i++ + i++ + i++; printf("%d",j);This code gives the answer 15.But if we replace the value of the j then anser is different?why? 2)int i=5; printf("%d",i++ + i++ + i++); this givs 18.
main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4
18 Answers HCL, IBM, Infosys, LG Soft, Satyam,
Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??
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,
main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }
main() { printf("%d", out); } int out=100;