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 / vadivel t

#include<stdio.h>
#include<math.h>
void main()
{
int a1[5] = {2,5,3,1,4}, a2[4] = {1,2,4,5};
int i, n = 5, sum1= 0, sum2 = 0;
for(i = 0; i <= n-1; i++)
{
sum1 = sum1 + a1[i];
if(i <= n-2)
{
sum2 = sum2 + a2[i];
}
}
printf("MISSED NO IS: %d",(sum1 - sum2));
_getch();
}

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does everyone say not to use gets?

1051


Is swift based on c?

1066


Is void a keyword in c?

937


What is data structure in c and its types?

1038


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1689


What is difference between constant pointer and constant variable?

1233


What is a nested loop?

1086


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15752


What do you mean by c what are the main characteristics of c language?

996


Explain how can I remove the trailing spaces from a string?

1011


What is #define in c?

1002


What are the uses of a pointer?

1124


Explain what math functions are available for integers? For floating point?

1081


Implement bit Array in C.

1111


How can I delete a file?

1024