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 is the benefit of using an enum rather than a #define constant?
How to create struct variables?
Why doesn't C support function overloading?
What are the different types of control structures in programming?
What is function prototype in c language?
What is methods in c?
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
What are logical errors and how does it differ from syntax errors?
Explain what math functions are available for integers? For floating point?
List some basic data types in c?
Why does everyone say not to use scanf? What should I use instead?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What are the applications of c language?
Can stdout be forced to print somewhere other than the screen?
How can I sort more data than will fit in memory?