Run
#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] = { {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))
printf ("Matrices are identical ");
else
printf ("Matrices are not identical");
return 0;
}
Run
#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;
}
Run
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");
}
}
Run
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")
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));
}
}
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
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)
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;
}
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];
}
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] << " ";
}
In which language is the automata question given?will we get the option to select the programming language in that?
We provide the coding questions in C and C++
what are the programming languages that will be given for the Wipro turbo challenge coding round?
Here are the languages thar are choosable in the Exam:
C
C++
Java
Python
coding in wipro is tough or moderate
Hi Ananya,
Coding is moderate in the Wipro Exam.
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.
Hi shilpa,
You can find the steps to access the Paid Materials from here -https://prepinsta.com/steps-to-access-paid-material/
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
Hi Saurabh, we are really glad that your exam went well.
And for Interview Preparation, you may just go through our Interview Experiences Dashboards – https://prepinsta.com/interview-experience/Wipro/
Wipro Coding Questions
Yes, Python is allowed as an coding language.
You can check detailed syllabus for Wipro here – https://prepinsta.com/wipro-syllabus/