Posts

Showing posts with the label technical question

SKILL ROCKS TECH THIRD QUESTION ANSWER

Q3 find the frequency of 1 to 9 from an array of size 100 having value 1 to 9 randomly arranged Conditions: 1. use only one loop. 2. do not use counters. 3. most efficiently  Answer suppose if array of 100 with random values between 1 to 9 were given then  simply answer is for(i=0;i<100;i++) {           count[ arr[i] ]++; // arr[i] is given array and count[] is frequency counter. } complete program is like this #include<conio.h> #include<iostream.h> #include<stdlib.h> void main() {     int arr[100],count[10],i,j;     clrscr();     for(i=0;i<20;i++)     {         arr[i]=random(10);     }     for(i=0;i<20; i++)     {         cout<<arr[i];         if(i%10==0)      ...

SKILL ROCKS TECH QUESTIONS

skillrocks technical interview question Q1 an array of 20 integer having digits 1 to 20 in random order, if we omit any one digit and replace it by zero find the number omitted. example |1|3|5|7|8|9|4|2|6|10|0|13|15|16|17|19|18|15|20|12|14| Q2 find the greatest no. from an array having random numbers of 100 size, with out sorting. Q3 find the frequency of 1 to 9 from an array of size 100 having value 1 to 9 randomly arranged Conditions: 1. use only one loop. 2. do not use counters. 3. most efficiently  Answer is waiting.....