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
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
What is the difference between union and anonymous union?
Is it possible to execute code even after the program exits the main() function?
Explain what are its uses in c programming?
What is echo in c programming?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
Explain the difference between structs and unions in c?
When should the register modifier be used? Does it really help?
How does #define work?
Can we declare variable anywhere in c?
What is the use of clrscr?
What does void main () mean?
Explain what’s a signal? Explain what do I use signals for?
Why #include is used in c language?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream