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 |
write a program in c to merge two array
given integer number,write a program that displays the number as follows: First line :all digits second line : all except the first digit . . . . Last line : the last digit
main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\n", 1L << i); } } a. 5, 4, 3, 2, 1 b. 0, 1, 2, 3, 4 c. 0, 1, 2, 4, 8 d. 1, 2, 4, 8, 16
What is the hidden bug with the following statement? assert(val++ != 0);
write a program for area of circumference of shapes
void main() { int i=5; printf("%d",i++ + ++i); }
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); }
Extend the sutherland-hodgman clipping algorithm to clip three-dimensional planes against a regular paralleiepiped
Write a program that find and print how many odd numbers in a binary tree
how to return a multiple value from a function?
main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i<n; ++i) { printf(“%s\n”,x); x++; } }
Give a one-line C expression to test whether a number is a power of 2.