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
What are the differences between new and malloc in C?
What are the types of pointers?
By using C language input a date into it and if it is right?
Not all reserved words are written in lowercase. TRUE or FALSE?
What is use of pointer?
What is the benefit of using an enum rather than a #define constant?
What is scope rule of function in c?
Why do we use return in c?
Explain what is the heap?
Is c still used?
What are the disadvantages of external storage class?
Explain the difference between the local variable and global variable in c?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
How was c created?
Can you add pointers together? Why would you?