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 |
pls anyone can help me to write a code to print the values in words for any value.Example:1034 to print as "one thousand and thirty four only"
C program to print magic square of order n where n > 3 and n is odd
main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d \n”,a,*a,**a,***a); printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1); }
What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }
write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?
Print an integer using only putchar. Try doing it without using extra storage.
main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above
Is this code legal? int *ptr; ptr = (int *) 0x400;
void main() { int c; c=printf("Hello world"); printf("\n%d",c); }
Which version do you prefer of the following two, 1) printf(“%s”,str); // or the more curt one 2) printf(str);
Is the following code legal? typedef struct a { int x; aType *b; }aType
Write a complete program that consists of a function that can receive two numbers from a user (M and N) as a parameter. Then print all the numbers between the two numbers including the number itself. If the value of M is smaller than N, print the numbers in ascending flow. If the value of M is bigger than N, print the numbers in descending flow. may i know how the coding look like?