write the function. if all the character in string B appear in
string A, return true, otherwise return false.
Answers were Sorted based on User's Feedback
Answer / kathiresan
#include<stdio.h>
#include<string.h>
int main()
{
char *str1 = "Hello";
char *str2 = "Hello";
int len1,len2;
len1 = strlen(str1);
len2 = strlen(str2);
if(len1 != len2)
{
printf("\nBoth Strings are not matched");
return 0;
}
while(*str1)
{
if(*str1 == *str2)
{
*str1++;
*str2++;
}
else
{
printf("\nString Not Matched\n");
return 0;
}
}
printf("\nBoth String are EQual");
}
| Is This Answer Correct ? | 0 Yes | 1 No |
#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(ā%dā, i); }
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };
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.
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
Write a program that find and print how many odd numbers in a binary tree
main() { extern int i; i=20; printf("%d",sizeof(i)); }
main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
main() { unsigned int i=65000; while(i++!=0); printf("%d",i); }
main() { extern out; printf("%d", out); } int out=100;
#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }