Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.


Please wait...

  Take Quiz (Monsoon) Beta Version !!
  Do You have Qs. in your Mind ??? Ask it as Qs. or MCQs or create it as polling Live Now !!

Programs Questions and Answers



    291 / 348

    Write a program to generate the next number (ex:143=1^2+4^2+3^2=26)repeat this sequence till you get 1 or 4.

    Input : NA


    Output : NA

    View Answer |  Stack |  Discuss in Forum | Add to Reading List To Reading List | Asked In |  Fresher
    Answer In:
     No Discussion on this question yet!

    Tags:Virtusa

    292 / 348

    Write a program to eliminate duplicates in a sorted array.

    Input : NA


    Output : NA

    View Answer |  Array |  Discuss in Forum | Add to Reading List To Reading List | Asked In |  Fresher
    Answer In: JAVA  
     
    public class Duplicates 
    

        public int eliminateDuplicates(int a[], int n) 
        { 
            if (n == 0 || n == 1)   //if the array is empty or if it contains only 1 element.
                return n;
            int j = 0; 
            for (int i = 0; i < n-1; i++) 
            {
                //If ith element is not equal to (i+1)th element, then store the ith element.
                if (a[i] != a[i+1]) 
                {
                    a[j++] = a[i]; 
                }
            }
            a[j++] = a[n-1]; //Also storig the last element. 
            return j; 
        } 
        public static void main(String[] args)  
        { 
            Duplicates ob=new Duplicates();
            int a[] = {1, 2, 2, 3, 4, 4, 4, 5, 5};    //sorted array
            int n = a.length; 
            n = ob.eliminateDuplicates(a, n); 
            for (int i=0; i<n; i++) 
               System.out.print(a[i]+" "); 
        } 
    }

    Tags:Virtusa

    293 / 348

    Write a recursive function to print 100 Fibonacci numbers.

    Input : NA


    Output : NA

    View Answer |  Basics |  Discuss in Forum | Add to Reading List To Reading List | Asked In |  Fresher
    Answer In: JAVA  
     
    public class Fibonacci
    
    {  
        static int a=0,b=1,c=0;    
        public void fibonacci(int num)
        {    
            if(num>0)
            {    
                c=a+b;    
                a=b;    
                b=c;    
                System.out.print(" "+c);   
                fibonacci(num-1);    
            }    
        }    
        public static void main(String args[])
        {    
            Fibonacci ob=new Fibonacci();
            int num=100;    
            System.out.print(a+" "+b);  //printing 0 and 1    
            ob.fibonacci(num-2);        //n-2 because 2 numbers are already printed   
        }  
    }  

    Tags:Virtusa

    294 / 348

    Write a program to Print the Pascal triangle.

    Input : NA


    Output : NA

    View Answer |  Basics |  Discuss in Forum | Add to Reading List To Reading List | Asked In |  Fresher
    Answer In: C   JAVA  
     
    <pre>
    <tt>#include<stdio.h>
    int main()
    {
      int i,j,k,s=1,n=5;
      for(i=0;i<n;i  )
      {
      Â  for(k=1;k<=n-i;k  )
      Â  printf(" ");
      Â  for(j=0;j<=i;j  )
      Â  {
      Â  Â  if(j==0||i==0)
      Â  Â  Â  s=1;
      Â  Â  else
      Â  Â  Â  s=s*(i-j 1)/j;
      Â  Â  printf("-",s);
      Â  }
      Â  printf("\n");

      }
    }</tt></pre>

    Tags:Virtusa

    295 / 348

    Write a program to print the angle between the pointers in the wall clock when time is taken as input.

    Input : NA


    Output : NA

    View Answer |  Basics |  Discuss in Forum | Add to Reading List To Reading List | Asked In |  Fresher
    Answer In:
     No Discussion on this question yet!

    Tags:Virtusa

    296 / 348

    Can trees be implemented using arrays? If so, write the program for same.

    Input : NA


    Output : NA

    View Answer |  Trees |  Discuss in Forum | Add to Reading List To Reading List | Asked In |  Fresher
    Answer In:
     No Discussion on this question yet!

    Tags:Virtusa

    297 / 348

    Write a Swapping program using XOR operation.

    Input : NA


    Output : NA

    View Answer |  Basics |  Discuss in Forum | Add to Reading List To Reading List | Asked In |  Fresher
    Answer In: JAVA  
     
    import java.util.*;
    
    public class SwapUsingXor
    {
        public static void main(String []args)
        {
            Scanner sc=new Scanner(System.in);
            System.out.println("Enter 2 numbers: ");
            int a=sc.nextInt();
            int b=sc.nextInt();
            System.out.println("Before swapping a= "+a+" || b= "+b);
            a=a^b;
            b=a^b;
            a=a^b;
            System.out.println("After swapping a= "+a+" || b= "+b);
        }
    }

    Tags:Virtusa

    298 / 348

    Write a program of Circular Queue.

    Input : NA


    Output : NA

    View Answer |  Stack |  Discuss in Forum | Add to Reading List To Reading List | Asked In |  Fresher
    Answer In:
     No Discussion on this question yet!

    Tags:Virtusa

    299 / 348

    Write a function which returns a sub string in the string 'Sigma' (character given) which starts with 'Alpha' and ends with 'Theta'.

    Input : NA


    Output : NA

    View Answer |  Strings |  Discuss in Forum | Add to Reading List To Reading List | Asked In |  Fresher
    Answer In: JAVA  
     
    import java.util.*;
    
    public class Substring
    {
        public static void main(String args[])
        {
            String str="";
            Scanner sc=new Scanner(System.in);
            System.out.println("Enter the string: ");
            String sigma=sc.nextLine();
            int len=sigma.length();
            System.out.println("Enter the beginIndex: ");
            int alpha=sc.nextInt();
            System.out.println("Enter the endIndex: ");
            int theta=sc.nextInt();
            if((alpha>=0 && theta<=len) && (alpha<theta))
                str=sigma.substring(alpha,theta);
            System.out.println("Substring is: "+str);
        }
    }

    Tags:Virtusa

    300 / 348

    Write a program to delete the duplicates in an array of student list.

    Input : NA


    Output : NA

    View Answer |  Array |  Discuss in Forum | Add to Reading List To Reading List | Asked In |  Fresher
    Answer In:
     No Discussion on this question yet!

    Tags:Virtusa