Searching for "zeroes"

Q:

Find the number of zeroes in 129!

 

A) 31 B)  33    
C)  35   D) 37
 
Answer & Explanation Answer: A) 31

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Problems on Numbers
Exam Prep: Bank Exams

Q:

If the zeroes of the polynomial x2 - ax + b are 3 and 4, then 'a' and 'b' are respectively equal to

A) 4, 3 B) 12, 7
C) 3, 4 D) 7, 12
 
Answer & Explanation Answer: D) 7, 12

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Simplification
Exam Prep: Bank Exams

Q:

Write an algorithm to separate all ones & zeroes in an array.

Answer

1. Have two indexes pointing to two ends of array, say i and j.


2. Approach towards each other with a check condition that they dont cross each other.


3. Each iteration of while loop, swap the numbers pointed by two indexes when num[i] index number is not equal to 1.


 


void sort()


{


     int a[]={1,0,0,0,1,1,0,1,0,1,0,0,1,0};


     int i=0;


     int j=13;


     int temp;


      while(j>i)


     {


          if(a[i]==1)


                 i++;


          if(a[j]==0)


                 j--;


          if(a[i]==0)


         {


                 temp=a[i];


                a[i]=a[j];


                a[j]=temp;


         }


     } 


     for(i=0;i<14;i++)


             Console.Write(a[i]+", ");


}


Output: 1,1,1,1,1,1,0,0,0,0,0,0,0

Report Error

View answer Workspace Report Error Discuss