Wipro Coding Questions

Wipro Programming Questions with Answers

Wipro Coding Questions is a very important section in Wipro off-campus or on-campus drives. In this round there are 2 problem statement, for which the students have to provide code for, in any of the mentioned languages they like to. The below are some of the practice questions that will help you in your preparation  for Wipro Coding Section.

  • Number of Questions – 2 Questions
  • Difficulty Level – 1 Easy + 1 Medium
  • Cut-off – Solve 1 question completely or 2 partial outputs
  • Languages allowed – C, C++, Java, Python

 

Wipro Coding Questions and Answers
Coding QuestionsWipro
Time60 mins
Number of Questions2
Coding DifficultyMedium
Adaptive TestNo

Wipro Coding Test Pattern

Wipro coding questions range from easy to difficult level. Out of the 2 questions asked in Wipro coding test, one is easy and the other is slightly difficult. You need to answer a minimum of 1 question, to clear the cut off. But in certain cases, if a lot of students have cleared all test cases for both the questions, then the cutoff might vary accordingly.

Key Points You Need To Remember

  • You need to implement the function signature, that has been provided by the editor
  • Use the function that is exactly provided in the problem as any deviation may lead to unsuccessful compilation of the code.
  • Do not modify pre-implemented main method
  • You may include necessary libraries if required.
  • The signature may call other functions defined by you.
  • It may also use structure definitions and other pre processing directives such as macros

Wipro Coding Syllabus and Pattern

Wipro coding test questions pattern and Facts – 

Wipro Coding Test Questions and Answers TypeProbability of Being AskedNumber of Question(Max)Time Alloted
Wipro Coding Pattern Question50%1within 60 mins
Wipro Coding Round Searching and Sorting Questions20%1within 60 mins
Functional Questions Like HCF and GCD20%0 – 1within 45 mins
Others10%1within 45 mins

Find the latest syllabus for Wipro here on this page.

Question 1

Problem Statement

Alex works at a clothing store. There is a large pile of socks that must be paired by color for sale. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are.

For example, there are n=7 socks with colors ar = {1,2,1,2,1,3,2}. There is one pair of color 1 and one of color 2. There are three odd socks left, one of each color. The number of pairs is 2.

Function Description
Complete the sockMerchant function in the editor below. It must return an integer representing the number of matching pairs of socks that are available.
sockMerchant has the following parameter(s):
             n: the number of socks in the pile
             ar: the colors of each sock

Input Format
            The first line contains an integer n, the number of socks represented in ar.
            The second line contains n space-separated integers describing the colors ar[i] of the socks in the pile.

Constraints
             1 <= n <= 100
             1 <= ar[i] <= 100 & 0 <= i < n

Output Format
             Return the total number of matching pairs of socks that Alex can sell.

Sample Input
             9
             10 20 20 10 10 30 50 10 20
Sample Output
             3

Explanation
             Alex can match 3 pairs of socks i.e 10-10, 10-10, 20-20
             while the left out socks are 50, 60, 20

#include<stdio.h>

int sockMerchant(int n, int arr[])
{
int freq[101]={0};
int ans = 0,i;
for(i=0;i<n;i++)
freq[arr[i]]++;
for(i = 0; i <= 100; i++)
{
ans = ans+ freq[i]/2;
}
return ans;
}
int main ()
{
int n;
scanf("%d",&n);
int arr[101],i;
for (i = 0; i < n; i++)
{
scanf("%d",&arr[i]);
}

int ans=sockMerchant(n,arr);
printf("%d\n",ans);
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int sockMerchant(int n, int arr[])
{
int freq[101]={0};
int ans = 0;
for(int i=0;i<n;i++)
{
int value=arr[i];
freq[value]++;
}
for(int i = 0; i <= 100; i++)
{
ans = ans+ freq[i]/2;
}

return ans;
}
int main ()
{
int n;
cin >> n;
int arr[n]={0};
for (int i = 0; i < n; i++)
{
cin>>arr[i];
}
int res=sockMerchant(n,arr);
cout<<res<<endl;
return 0;
}
import java.util.*;
class Main
{
public static int sockMerchant(int n, int arr[])
{
int freq[]=new int[101];
for(int i=0;i<n;i++)
{
freq[arr[i]]++;
}
int ans=0;
for(int i=0;i<=100;i++)
ans=ans+freq[i]/2;
return ans;
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int arr[]=new int[n];
for(int i=0;i<n;i++)
arr[i]=sc.nextInt();
int ans=sockMerchant(n,arr);
System.out.println(ans);

}
}
def sockMerchant(nar):
    pairs = 0
    set_ar = set(ar)
    for i in set_ar:
        count = ar.count(i)
        pairs+=count//2
    return pairs
    
n = int(input())
ar = list(map(intinput().split()))
print(sockMerchant(n, ar))

Question : 2 – Counting Valleys

Problem Statement

Gary is an avid hiker. He tracks his hikes meticulously, paying close attention to small details like topography. During his last hike, he took exactly n steps. For every step he took, he noted if it was an uphill or a downhill step. Gary’s hikes start and end at sea level. We define the following terms:

  • A mountain is a non-empty sequence of consecutive steps above sea level, starting with a step up from sea level and ending with a step down to sea level.
  • A valley is a non-empty sequence of consecutive steps below sea level, starting with a step down from sea level and ending with a step up to sea level.

Given Gary’s sequence of up and down steps during his last hike, find and print the number of valleys he walked through.

Input Format

The first line contains an integer, , denoting the number of steps in Gary’s hike.

The second line contains a single string of characters. Each character belongs to {U, D} (where U indicates a step up and D indicates a step down), and the i(th) cin the string describes Gary’s i(th) step during the hike.

Constraints

  • 2 <= N <= 10^6

Output Format

Print a single integer denoting the number of valleys Gary walked through during his hike.

Sample Input

8

UDDDUDUU 

Sample Output

1

Explanation

If we represent _ as sea level, a step up as / , and a step down as \ , Gary’s hike can be drawn as:

_/\      _

    \    /

     \/\/

It’s clear that there is only one valley there, so we print on a new line.

#include 
#include  
int countingValley(long int stepschar *path)
{
    long int ilevel = 0valley = 0;
    for(i=0i<stepsi++)
    {
        if(path[i] == 'U')
        {
            level++;
        }
        else if(path[i] == 'D')
        {
            if(level == 1)
            {
                valley++;
            }
            level--;
        }    
    }
    return valley;
}
int main()
{
    long int steps;
    scanf("%li",&steps);
    char path[steps];
    int iresult;
    for(i=0i<stepsi++)
    {
        scanf("%c",&path[i]);
    }
    result = countingValley(stepspath);
    printf("%d",result);
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
int countingValley(long int steps, char *path)
{
long int i, level = 0, valley = 0;
for(i=0; i<steps; i++)
{
if(path[i] == 'U')
{
level++;
}
else if(path[i] == 'D')
{
if(level == 1)
{
valley++;
}
level--;
}
}
return valley;
}
int main()
{
long int steps;
cin>>steps;
char path[steps];
int i, result;
for(i=0; i<steps; i++)
{
cin>>path[i];
}
result = countingValley(steps, path);
cout<<result;
return 0;
}
import java.util.*;
class Main
{
public static int countingValley(int n, String path)
{
int level=0,valley=0;
for(int i=0;i<n;i++)
{
if(path.charAt(i)=='U')
level++;
else if(path.charAt(i)=='D')
{
if(level==1)
valley++;
level--;
}
}
return valley;
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
String str=sc.next();
int result=countingValley(n,str);
System.out.println(result);
}
}
def countingValley(stepspath):
    level = valley = 0
    for i in path:
        if i == 'U':
            level += 1
        elif i == 'D':
            if level == 1:
                valley += 1
            level -= 1
    return valley
    
steps = int(input())
path = input()
print(countingValley(steps, path))

Question : 3 – Left Rotation

Problem Statement

A left rotation operation on an array shifts each of the array’s elements unit to the left. For example, if 2 left rotations are performed on array [1, 2, 3, 4, 5], then the array would become [3, 4, 5, 1, 2].

Given an array of integers and a number, , perform left rotations on the array. Return the updated array to be printed as a single line of space-separated integers.

Function Description

Complete the function rotLeft in the editor below. It should return the resulting array of integers.

rotLeft has the following parameter(s):

  • An array of integers .
  • An integer , the number of rotations.

Input Format

The first line contains two space-separated integers and , the size of and the number of left rotations you must perform.

The second line contains space-separated integers a[i].

Constraints

  • 1 <= n <= 10^5
  • 1 <= d <= n
  • 1 <= a[i] <= 10^8

Output Format

Print a single line of space-separated integers denoting the final state of the array after performing d left rotations.

Sample Input
5 4
1 2 3 4 5

Sample Output
5 1 2 3 4

Explanation
When we perform d=4 left rotations, the array undergoes the following sequence of changes:

[1,2,3,4,5] → [2,3,4,5,1] → [3,4,5,1,2] → [4,5,1,2,3] → [5,1,2,3,4]

Test Case : 1

Input (stdin)

  • 5 4
  • 1 2 3 4 5

Expected Output

  • 5 1 2 3 4

Test Case : 2
Input (stdin)

  • 20 10
  • 41 73 89 7 10 1 59 58 84 77 77 97 58 1 86 58 26 10 86 51

Expected Output

  • 77 97 58 1 86 58 26 10 86 51 41 73 89 7 10 1 59 58 84 77
#include <stdio.h>
int rotLeft(int arr[]int nint d)
{
    int i, j;
    int first;
    for(i=0; i<d; i++)
    {
        first = arr[0];
        for(j=0; j<n-1; j++)
        {
            arr[j] = arr[j+1];
        }
        arr[j] = first;
    }
    return *arr;
}
int main()
{
    int n, d, i;
    scanf("%d",&n);
    scanf("%d",&d);
    int list[n];
    for(i=0; i<n; i++)
    {
        scanf("%d",&list[i]);
    }
    rotLeft(list, n, d);
    for(i=0; i<n; i++)
    {
        printf("%d ",list[i]);
    }
}
#include<bits/stdc++.h>
using namespace std;
int rotLeft(int arr[], int n, int d)
{
int i, j;
int first;
for(i=0; i<d; i++)
{
first = arr[0];
for(j=0; j<n-1; j++)
{
arr[j] = arr[j+1];
}
arr[j] = first;
}
return *arr;
}
int main()
{
int n, d, i;
cin>>n;
cin>>d;
int list[n];
for(i=0; i<n; i++)
{
cin>>list[i];
}
rotLeft(list, n, d);
for(i=0; i<n; i++)
{
cout<<list[i]<<" ";
}
}
import java.util.*;
class Main
{
public static void rotateLeft(int a[],int n, int d)
{
int first,i,j;
for(i=0;i<d;i++)
{
first=a[0];
for(j=0;j<n-1;j++)
a[j]=a[j+1];
a[j]=first;
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int d=sc.nextInt();
int a[]=new int[n];
for(int i=0;i<n;i++)
a[i]=sc.nextInt();

rotateLeft(a,n,d);

for(int i=0;i<n;i++)
System.out.print(a[i]+" ");
}
}
def rotateLeft(n,d,arr):
    for i in range(d):
        arr = rotatearr(n,arr)
    return arr
    
def rotatearr(narr):
    first = arr[0]
    for i in range(n-1):
        arr[i] = arr[i+1]
    arr[n-1] = first
    return arr

, d = map(intinput().split())
arr = list(map(intinput().split()))
for i in rotateLeft(n,d,arr):
    print(i, end=" ")

Question 4

Ques:  C Program to check if two given matrices are identical

#include<stdio.h>
#define N 4
// This function returns 1 if A[][] and B[][] are identical
// otherwise returns 0
int areSame (int A[][N], int B[][N])
{
  int i, j;
  for (i = 0; i < N; i++)
    for (j = 0; j < N; j++)
      if (A[i][j] != B[i][j])
    return 0;
  return 1;
}
int main ()
{
  int A[N][N] = { {1111},
  {2222},
  {3333},
  {4444}
  };
  int B[N][N] = { {1111},
  {2222},
  {3333},
  {4444}
  };
  if (areSame (A, B))
    printf ("Matrices are identical ");
  else
    printf ("Matrices are not identical");
  return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define N 4
// This function returns 1 if A[][] and B[][] are identical
// otherwise returns 0
int areSame (int A[][N], int B[][N])
{
int i, j;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
if (A[i][j] != B[i][j])
return 0;
return 1;
}
int main ()
{
int A[N][N] = { {1, 1, 1, 1},
{2, 2, 2, 2},
{3, 3, 3, 3},
{4, 4, 4, 4}
};
int B[N][N] = { {1, 1, 1, 1},
{2, 2, 2, 2},
{3, 3, 3, 3},
{4, 4, 4, 4}
};
if (areSame (A, B))
cout<<"Matrices are identical";
else
cout<<"Matrices are not identical";
return 0;
}
import java.util.*;
class Main
{
static int size=4;
public static boolean areSame(int A[][], int B[][])
{
int i,j;
for(i=0;i<size;i++)
{
for(j=0;j<size;j++)
if(A[i][j]!=B[i][j])
return false;
}
return true;
}
public static void main(String[] args)
{
int A[][]={{1,1,1,1},{2,2,2,2},{3,3,3,3,},{4,4,4,4}};
int B[][]={{1,1,1,1},{2,2,2,2},{3,3,3,3,},{4,4,4,4}};
if(areSame(A,B))
{
System.out.println("Matrices are identical");
}
else
System.out.println("Matrices are not identical");
}
}
a = [[1,1,1,1],[2,2,2,2],[3,3,3,3],[4,4,4,4]]
b = [[1,1,1,1],[2,2,2,2],[3,3,3,3],[4,4,4,4]]
if a==b:
    prin("Metrices are identical")
else:
    pint("Metrices are not identical")

Question 5

Ques: Given a 2D array, print it in spiral form. See the following examples.

NOTE:-  Please comment down the code in other languages as well below .

Input:
        1    2   3   4
        5    6   7   8
        9   10  11  12
        13  14  15  16
Output: 
1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10 
Input:
        1   2   3   4  5   6
        7   8   9  10  11  12
        13  14  15 16  17  18
Output: 
1 2 3 4 5 6 12 18 17 16 15 14 13 7 8 9 10 11

 

#include <stdio.h>
#define R 3
#define C 6
void spiralPrint (int mint nint a[R][C])
{
    int ik = 0l = 0;
    /* k - starting row index 
    m - ending row index 
    l - starting column index 
    n - ending column index 
    i - iterator 
    */
    while (k < m && l < n)
    {
        /* Print the first row from the remaining rows */
        for (i = li < n; ++i)
        {
            printf ("%d "a[k][i]);
        }
        k++;
        /* Print the last column from the remaining columns */
        for (i = ki < m; ++i)
        {
            printf ("%d "a[i][n - 1]);
        }
        n--;
        /* Print the last row from the remaining rows */
        if (k < m
        { 
            for (i = n - 1i >= l; --i)
            {
                printf ("%d "a[m - 1][i]);
            }
            m--;
        }
        /* Print the first column from the remaining columns */
        if (l < n
        { 
            for (i = m - 1i >= k; --i)
            {
                printf ("%d "a[i][l]);
            }
            l++;
        }
    }
}
/* Driver program to test above functions */
int main ()
{
    int a[R][C] = { {123456},
    {789101112},
    {131415161718}
    };
    spiralPrint (RCa);
    return 0;
}
#include <bits/stdc++.h> 
using namespace std; 
#define R 3 
#define C 6 
void spiralPrint(int mint nint a[R][C]) 

    int ik = 0l = 0
    /* k - starting row index 
        m - ending row index 
        l - starting column index 
        n - ending column index 
        i - iterator 
    */
    while (k < m && l < n) { 
        /* Print the first row from 
            the remaining rows */
        for (i = li < n; ++i) { 
            cout << a[k][i] << " "
        } 
        k++; 
        /* Print the last column 
        from the remaining columns */
        for (i = ki < m; ++i) { 
            cout << a[i][n - 1] << " "
        } 
        n--; 
        /* Print the last row from 
                the remaining rows */
        if (k < m) { for (i = n - 1i >= l; --i) { 
                cout << a[m - 1][i] << " "
            } 
            m--; 
        } 
        /* Print the first column from 
                the remaining columns */
        if (l < n) { for (i = m - 1i >= k; --i) { 
                cout << a[i][l] << " "
            } 
            l++; 
        } 
    } 

/* Driver program to test above functions */
int main() 

    int a[R][C] = { { 123456 }, 
                   { 789101112 }, 
                    { 131415161718 } }; 
    spiralPrint(RCa); 
    return 0
}
// Java program to print a given matrix in spiral form 
import java.io.*;
class Main
{
// Function print matrix in spiral form 
  static void spiralPrint (int mint nint a[][])
  {
    int ik = 0l = 0;
    /* k - starting row index 
    m - ending row index 
    l - starting column index 
    n - ending column index 
    i - iterator 
    */
    while (k < m && l < n)
    {
    // Print the first row from the remaining rows 
    for (i = li < n; ++i)
      {
        System.out.print (a[k][i] + " ");
      }
    k++;
    // Print the last column from the remaining columns 
    for (i = ki < m; ++i)
      {
        System.out.print (a[i][n - 1] + " ");
      }
    n--;
    // Print the last row from the remaining rows */ 
    if (k < m)
      {
        for (i = n - 1i >= l; --i)
          {
        System.out.print (a[m - 1][i] + " ");
          }
        m--;
      }
    // Print the first column from the remaining columns */ 
    if (l < n)
      {
        for (i = m - 1i >= k; --i)
          {
        System.out.print (a[i][l] + " ");
          }
        l++;
      }
    }
  }
  // driver program 
  public static void main (String[]args)
  {
    int R = 3;
    int C = 6;
    int a[][] = { {123456},
    {789101112},
    {131415161718}
    };
    spiralPrint (RCa);
  }
}
def spiralOrder(arr):
    ans=[]
    while arr:
        ans+=arr.pop(0)
        arr= (list(zip(*arr)))[::-1]
    return ans
arr=[[123456],[789101112],[131415161718]]
print(spiralOrder(arr))

Question 6

​Ques: A Pythagorean triplet is a set of three integers a, b and c such that a2 + b2 = c2. Given a limit, generate all Pythagorean Triples with values smaller than given limit.

Input : limit = 20
Output : 3 4 5
         8 6 10
         5 12 13
         15 8 17
         12 16 20

Simple Solution is to generate these triplets smaller than given limit using three nested loop. For every triplet, check if Pythagorean condition is true, if true, then print the triplet. Time complexity of this solution is O(limit3) where ‘limit’ is given limit.

An Efficient Solution can print all triplets in O(k) time where k is number of triplets printed. The idea is to use square sum relation of Pythagorean triplet, i.e., addition of squares of a and b is equal to square of c, we can write these number in terms of m and n such that,

       a = m2 - n2
       b = 2 * m * n
       c  = m2 + n2
because,
       a2 = m4 + n4 – 2 * m2 * n2
       b2 = 4 * m2 * n2
       c2 = m4 + n4 + 2* m2 * n2

We can see that a2 + b2 = c2, so instead of iterating for a, b and c we can iterate for m and n and can generate these triplets

//  A C program to generate pythagorean triplets
// smaller than a given limit
#include <stdio.h>
#include <math.h>
//  Function to generate pythagorean triplets
//  smaller than limit
void pythagoreanTriplets (int limit)
{
    // triplet:  a^2 + b^2 = c^2
  int abc = 0;
    //  loop from 2 to max_limitit
  int m = 2;
    // Limiting c would limit all a, b and c
  while (c < limit)
    {
    // now loop on j from 1 to i-1
      for (int n = 1n < m; ++n)
    {
    // Evaluate and print triplets using
    // the relation between a, b and c
      a = m * m - n * n;
      b = 2 * m * n;
      c = m * m + n * n;
      if (c > limit)
        break;
      printf ("%d %d %d \n"abc);
    }
      m++;
    }
}
// Driver program
int main ()
{
  int limit = 20;
  pythagoreanTriplets (limit);
  return 0;
}
#include<bits/stdc++.h>
using namespace std;
// Function to generate pythagorean triplets
// smaller than limit
void pythagoreanTriplets (int limit)
{
// triplet: a^2 + b^2 = c^2
int a, b, c = 0;
// loop from 2 to max_limitit
int m = 2;
// Limiting c would limit all a, b and c

while (c < limit)
{
// now loop on j from 1 to i-1
for (int n = 1; n < m; ++n)
{
// Evaluate and print triplets using
// the relation between a, b and c
a = m * m - n * n;
b = 2 * m * n;
c = m * m + n * n;
if (c > limit)
break;
cout<<a<<" "<<b<<" "<<c<<endl;
}
m++;
}
}
// Driver program
int main ()
{
int limit = 20;
pythagoreanTriplets (limit);
return 0;
}
import java.util.*;
class Main
{
public static void pythagoreanTriplets(int limit)
{
int a,b,c=0;
int m=2;
while(c<limit)
{
for(int n=1;n<m;++n)
{
a=m*m-n*n;
b=2*m*n;
c=m*m+n*n;
if(c>limit)
break;
System.out.println(a+" "+b+" "+c);
}
m++;
}
}
public static void main(String[] args)
{
int limit=20;
pythagoreanTriplets(limit);
}
}
def pythagoreanTriplets(limit):
    a = b = c = 0
    m = 2
    while True:
        for n in range(1,m+1):
            a = m*m - n*n
            b = 2*m*n
            c = m*m + n*n
            if c > limit:
                break
            if a==0 or b==0 or c==0:
                break
            print(a,b,c)
        m=m+1
        
limit = int(input())
pythagoreanTriplets(limit)

Wipro Placement Coding Questions based FAQ's

Ques. In total when I am attending Wipro exam, how many questions will there be for my Wipro Coding Test?

Ans. There are generally one easy question which will mostly be a pattern based program and the other question will be non pattern question like GCD of two numbers etc.

Ques. Are these questions valid for Wipro NLTH exam as well, will it benefit for me if I study from here for that as well?

Ans. Wipro NLTH test is also conducted by Wipro but  the level of difficutly is high, thus you can study from our Wipro NLTH Coding Questions Page.

Ques.What is the level of difficulty for Wipro coding test questions?

Ans. Wipro Coding Questions are of moderate difficulty but you need to score atleast 70%ile in this section to get to the next round necessarily.

Disclaimer-: The questions provided on this page are only model practice questions there is no surety that these questions have been previously asked in any company placement papers, these questions here only have the sole purpose to make you practice coding questions

18 comments on “Wipro Coding Questions”


  • Shreevathsan

    Left roation problem … java soln
    import java.util.*;
    class leftrotate
    {
    public static void main(String args[])
    {

    Scanner sc=new Scanner(System.in);
    System.out.println(“enter the value of n”);
    n=sc.nextInt();
    int[] a=new int[n];
    int[] b=new int[n];
    int[] c=new int[n];
    int i,j,n,k=0;
    int f=0;
    System.out.println(“enter the array”);

    for(i=0;i<n;i++)
    {
    a[i]=sc.nextInt();
    }
    int m=sc.nextInt();
    for(i=m;i<n;i++)
    {
    b[k]=a[i];
    k++;
    }
    for(i=0;i<m;i++)
    {
    c[f]=a[i];
    f++;
    }

    int[] ans=new int[k+f];
    System.arraycopy(b,0,ans,0,k);
    System.arraycopy(c,0,ans,k,f);
    System.out.println(Arrays.toString(ans));
    }
    }


  • Dhrumil

    python code:
    limit = 20
    a_data = []
    b_data = []

    for a in range(1, limit+1):
    for b in range(1, limit+1):
    for c in range(1, limit+1):
    if (a*a)+(b*b) == (c*c) and (b not in a_data and a not in b_data):
    a_data.append(a)
    b_data.append(b)
    print(a, b, c)
    else:
    c += 1
    b += 1
    a += 1


  • kala

    for q-3 the below one is more simpler:
    n=int(input())
    k=int(input())
    l=list(map(int,input().split()))
    h=l.copy()
    for i in range(len(l)):
    j=i-k
    h[j]=l[i]
    print(h)


  • ayushi

    QUESTION 5
    #include
    #define R 3
    #define C 6
    void spiralPrint (int m, int n, int a[R][C])
    {
    int i=0,j=0,k=0;
    for(i=0;i<m;i++)
    {
    if(i%2==0)
    {

    for(j=0;j=0;k–)
    {
    printf(” %d”,a[i][k]);
    }
    }
    }
    }

    int main ()
    {
    int a[R][C] = { {1, 2, 3, 4, 5, 6},
    {7, 8, 9, 10, 11, 12},
    {13, 14, 15, 16, 17, 18}
    };
    spiralPrint (R, C, a);
    return 0;
    }


  • Vikash

    int main()
    {
    int n,d;
    cin >> n >> d;
    int arr[n];
    for(int i=0;i> arr[i];
    for(int i=(d%n) ;i<n+(d%n) ; i++)
    cout << arr[i%n];
    }


  • Vikash

    for question 3
    #include
    using namespace std;

    int main()
    {
    int n,d;
    cin >> n >> d;
    int arr[n];
    for(int i=0;i> arr[i];

    for(int i=(d%n);i<n+(d%n);i++)
    cout << arr[i%n] << " ";
    }


  • Kriti

    In which language is the automata question given?will we get the option to select the programming language in that?


  • Shilpa Shirahatti

    i have ordered both coding and verbal sections for wipro, amount for both materials is debited but i m nt able to access the material,plz check.


  • Saurabh

    Thanks Prepinsta, i gave exam yesterday around 2 questions got repeated from this page and around 40-50% of the questions were similar or repeated from your online classes :).

    Is there any course for interview preparation also