#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 |
Printf can be implemented by using __________ list.
Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.
How can you relate the function with the structure? Explain with an appropriate example.
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 a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }
void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }
how can u draw a rectangle in C
53 Answers Accenture, CO, Codeblocks, Cognizant, HCL, Oracle, Punjab National Bank, SAP Labs, TCS, University, Wipro,
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }
/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }