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 *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); }
String reverse with time complexity of n/2 with out using temporary variable.
how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns
main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }
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.
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
abcdedcba abc cba ab ba a a
How to reverse a String without using C functions ?
33 Answers Matrix, TCS, Wipro,
#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); }
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
program to find the roots of a quadratic equation
14 Answers College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,