Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 Help Members By Posting Answers For Below Questions

Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

2127


State the difference between realloc and free.

1070


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

1283


How can you read a directory in a C program?

1142


What is array in c with example?

1252


Is it possible to pass an entire structure to functions?

998


What are the header files used in c language?

1055


Is javascript based on c?

1061


What's the difference between constant char *p and char * constant p?

1148


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

1339


Do character constants represent numerical values?

1339


How do I get an accurate error status return from system on ms-dos?

1124


What is a program?

1258


Is the exit() function same as the return statement? Explain.

1100


What are the different categories of functions in c?

1133