retagged by
530 views

1 Answer

0 votes
0 votes
in this , we will do linear search . we will iterate our while loop till our key not found and then break our loop. and use one variable that do count++ and after when found we print the count value …

int index =0;

while(a[index]!=key){

index++;

} cout<<index;

Related questions

133
views
2 answers
1 votes
kirmada asked Jun 20
133 views
#include <stdio.h> int main() { int (*a)[2]; int arr[4][4]={1,2,3,4,6,7,8,9}; a=arr; ++a; printf("%d",**a); return 0; }what is the answer NUMARICAL--------------------------------?
82
views
0 answers
1 votes
shivamSK asked Jun 19
82 views
#include <stdio.h> void f(int (*x)(int)); int mysh(int); int (*sh)() = mysh; int main() { f(sh); sh++; for(int x=sh;x>=0;x--){ if(x){ printf ... A:10C:10 i will go thereB:10 i will go there number of timesD:10 i will go here number of times
140
views
1 answers
1 votes
shivamSK asked Jun 15
140 views
#include <stdio.h> int main () { int i, k; int a [8] = {33,34,35,36,37,40,50,38}; for(i = 0; i < 3; i++) { a[i] = a[i] + 1; i=i+1; } ... int i = k/2; a[i] = a[i] - 1; } printf ("%d",i+a[i]); }Numerical Answer ______________________________
685
views
1 answers
8 votes
GO Classes asked Feb 5
685 views
Consider the following C code:double A[2][3] = {{1, 2, 3}, {4, 5, 6}};Assume that A[0] = 0xFFAA0000 and the sizeof(double) is 8.What will be the value of `A[1]`?0xFFAA00240xFFAA00030xFFAA000C0xFFAA0018