main()
{
static char
names[5][20]={"pascal","ada","cobol","fortran","perl"};
int i;
char *t;
t=names[3];
names[3]=names[4];
names[4]=t;
for (i=0;i<=4;i++)
printf("%s",names[i]);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
Compiler error: Lvalue required in function main
Explanation:
Array names are pointer constants. So it cannot be
modified.
Is This Answer Correct ? | 15 Yes | 1 No |
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above
Write a c program to search an element in an array using recursion
what is the output of following program ? void main() { int i=5; printf("%d %d %d %d %d ",i++,i--,++i,--i,i); }
how can i cast a char type array to an int type array
how to concatenate the two strings
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,
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }
#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a * ++a * ++a; printf("post=%d pre=%d",post,pre); return 0; }
There is a lucky draw held every day. if there is a winning number eg 1876,then all possible numbers like 1867,1687,1768 etc are the numbers that match irrespective of the position of the digit. Thus all these numbers qualify fr the lucky draw prize Assume there is no zero digit in any numbers. write a program to show all the possible winning numbers if a "winning number"is passed as an arguments to the function.
main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }
main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }