if array a conatins 'n' elements and array b conatins 'n-1'
elements.array b has all element which are present in array
a but one element is missing in array b. find that
element.
Answer Posted / furquan
@Rasika : It will work even for array of characters i.e.
string. It will calculate on the ascii value.
int main()
{
char a[] = "abcghs", b[] = "abchs";
int sum = 0,i;
int n = strlen(a);
for (i=0;i<n-1;i++){
sum += a[i] - b[i];
}
sum += a[i];
printf("%c\n",sum);
return 0;
}
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
State the difference between realloc and free.
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
How can you read a directory in a C program?
What is array in c with example?
Is it possible to pass an entire structure to functions?
What are the header files used in c language?
Is javascript based on c?
What's the difference between constant char *p and char * constant p?
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
Do character constants represent numerical values?
How do I get an accurate error status return from system on ms-dos?
What is a program?
Is the exit() function same as the return statement? Explain.
What are the different categories of functions in c?