main()
{
char str1[] = {‘s’,’o’,’m’,’e’};
char str2[] = {‘s’,’o’,’m’,’e’,’\0’};
while (strcmp(str1,str2))
printf(“Strings are not equal\n”);
}
Answer / susie
Answer :
“Strings are not equal”
“Strings are not equal”
….
Explanation:
If a string constant is initialized explicitly with
characters, ‘\0’ is not appended automatically to the
string. Since str1 doesn’t have null termination, it treats
whatever the values that are in the following positions as
part of the string until it randomly reaches a ‘\0’. So str1
and str2 are not the same, hence the result.
| Is This Answer Correct ? | 2 Yes | 1 No |
void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(“%d”,k); }
main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }
how to return a multiple value from a function?
main() { main(); }
# include<stdio.h> aaa() { printf("hi"); } bbb(){ printf("hello"); } ccc(){ printf("bye"); } main() { int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc; ptr[2](); }
void main() { int i=5; printf("%d",i+++++i); }
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }
main() { extern out; printf("%d", out); } int out=100;
What is full form of PEPSI
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates.
19 Answers Amazon, BITS, Microsoft, Syncfusion, Synergy, Vector,
main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }
Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.