Wipro Elite NTH Coding Questions & Answers 2024 (Fresher/Experience)

Wipro Elite NTH Coding Questions & Answers 2024 | Wipro Elite NTH Coding Questions | Wipro Elite NTH Assessment Coding Questions | Wipro Elite NTH Coding Round Questions | Wipro Elite NTH Codility Test Questions and Answers 

Wipro Elite NTH Coding Questions & Answers 2024:  Aspirants who pass in the Online Test will qualify for the coding test process. The coding test will be conducted for the process to check the candidate’s capability. The coding questions will be asked in any language. In the below section, we have provided the Java, C, C++, and Python Coding Questions with Solutions. With the clear Explanation, we have provided all the details here. Solve the Frequently Asked coding test Questions to help with your study.

Before entering the coding test, aspirants can start their preparation by downloading or viewing the practice questions. Here we have provided the study material for the coding test. More details like Wipro Elite NTH Coding Questions and Answers, Wipro Elite NTH Coding MCQ Questions and Answers, Wipro Elite NTH Interview Questions and Answers, Cut Off, Salary, Hike, Increment, Annual Appraisal, etc. are available on this page

Wipro Elite NTH Coding Question and Answers 

Q) Wipro’s client eBay wants to run a campaign on their website, which will have the following parameters, eBay wants that on certain x products, they want to calculate the final price, for each product on eBay there will be a stock unit parameter, this parameter will denote, how many items are their in their fulfillment center

Now, while these numbers if are positive means product x is available in the fulfillment center and if not than the product is not available and cannot be shipped to the customer

Now the price on for each product varies based on the distance of the customer from the fulfillment center. Now, each product is in different fulfillment zone. Now, these values are 00’s kms for each centurion km. The price available would further increase by factor distance.

You’ve to find the maximum discount price for each product if the product can be shipped.

Following are the input/output parameters :

Input

  •  The first line of the input will contain number of products.
  • The second line will contain price for each of these products.
  • The third line contains shipping distance in 00’s kms
  • The fourth line contains SKU’s

Output

  • It will contain the final price for each deliverable item in SKU’s

Example :

Input:

  • 6
  • 87 103 229 41 8 86
  • 3 1 9 2 1 2
  • 7 -21 30 0 -4 -3

Output

  • 261 2061
C PROGRAM 
#include <stdio.h> 
int main()
{
    int noOfProducts;
    scanf("%d",&noOfProducts);
    
    int price[noOfProducts], distance[noOfProducts], sku[noOfProducts];
    for(int i=0;i<noOfProducts;i++)
    {
        scanf("%d",&price[i]);
    }
    for(int i=0;i<noOfProducts;i++)
    {
        scanf("%d",&distance[i]);
    }
    for(int i=0;i<noOfProducts;i++)
    {
        scanf("%d",&sku[i]);
    }
    
    int final_Price[noOfProducts];
    int count =0;
    for(int i=0;i<noOfProducts;i++)
    {
        if(sku[i]>0)
        {
            final_Price[count]= price[i] * distance[i];
            count++;
        }
    }
        for(int i=0;i<count;i++)
        {
            printf("%d ", final_Price[i]);
        }
    return 0;
}
JAVA PROGRAM 
import java.util.*;
class Main 
{
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        int noOfProducts=sc.nextInt();
int price[]=new int[noOfProducts];
int distance[]=new int[noOfProducts];
int sku[]=new int[noOfProducts];

for(int i=0;i<noOfProducts;i++)
price[i]=sc.nextInt();

for(int i=0;i<noOfProducts;i++)
distance[i]=sc.nextInt();

for(int i=0;i<noOfProducts;i++)
sku[i]=sc.nextInt();

int finalPrice[]=new int[noOfProducts];
int count =0;

for(int i=0;i<noOfProducts;i++)
{
if(sku[i]>0)
{
finalPrice[count]= price[i] * distance[i];
count++;
}
}

for(int i=0;i<count;i++)
{
System.out.print(finalPrice[i]+" ");
}
}
}

PYTHON PROGRAM 
number_of_products = int(input())
list_price = list(input().split(" "))
list_distance = list(input().split(" "))
list_sku = list(input().split(" "))
list_final=[]
for item in range (0, number_of_products):
    if int(list_sku[item]) >0 :
        temp_val = int(list_price[item]) * int(list_distance[item])
        list_final.append(temp_val)
for item in range(0, len(list_final)):
    print(list_final[item], sep=" ",end=" ")

Q) in this first line you are required to take the value of m and n as the number of rows and columns of matrix, then you are required to take the input elements of array.
As an output you are required to print the sum of each row then the row having the maximum sum.
Test Case :
Input : 3 3
1 2 3
4 5 6
7 8 9
Output :
Row 1 : 6
Row 2 : 15
Row 3 : 24
Row 3 is having the maximum sum : 24

C PROGRAM 
#include <stdio.h> 
int main()
{
    int row, colm, i, j, temp, max = 1;
    int mat[100][100];
    int sum[100];
    printf("enter the number of rows : ");
    scanf("%d",&row);
    printf("enter the number of columms : ");
    scanf("%d",&colm);
    for(i=0; i<row; i++)
    {
        for(j=0; j<colm; j++)
        {
            printf("enter [%d %d] element : ",i+1,j+1);
            scanf("%d",&mat[i][j]);
        }
    }
    for(i=0; i<row; i++)
    {
        sum[i] = 0;
        for(j=0; j<colm; j++)
        {
            sum[i] = sum[i] + mat[i][j];
        }
        printf("\n");
    }
    for(i=0; i<row; i++)
    {
        printf("Row %d : %d\n",i+1,sum[i]);
    }
    for(i=0; i<row; i++)
    {
        if(sum[0]<sum[i+1])
        {
            temp = sum[0];
            sum [0] = sum[i+1];
            sum[i+1] = temp;
            max = max+1;
        }
    }
    printf("\nRow %d is having the maximum sum : %d",max,sum[0]);
    return 0;
}

C++ PROGRAM 

#include <iostream>

int main() {
    int row, colm, i, j, temp, max = 1;
    int mat[100][100];
    int sum[100];
    
    std::cout << "Enter the number of rows: "; std::cin >> row;
    std::cout << "Enter the number of columns: "; std::cin >> colm;
    
    for(i = 0; i < row; i++) {
        for(j = 0; j < colm; j++) {
            std::cout << "Enter [" << i + 1 << "][" << j + 1 << "] element: "; std::cin >> mat[i][j];
        }
    }
    
    for(i = 0; i < row; i++) {
        sum[i] = 0;
        for(j = 0; j < colm; j++) {
            sum[i] += mat[i][j];
        }
        std::cout << std::endl;
    }
    
    for(i = 0; i < row; i++) {
        std::cout << "Row " << i + 1 << ": " << sum[i] << std::endl;
    }
    
    for(i = 0; i < row; i++) {
        if(sum[0] < sum[i + 1]) {
            temp = sum[0];
            sum[0] = sum[i + 1];
            sum[i + 1] = temp;
            max = max + 1;
        }
    }
    
    std::cout << std::endl;
    std::cout << "Row " << max << " is having the maximum sum: " << sum[0] << std::endl;
    
    return 0;
}
JAVA PROGRAM 
import java.util.*;

class Main 
{
  
public static void main (String[]args) 
  {
    
Scanner sc = new Scanner (System.in);
    
int m = sc.nextInt ();
    
int n = sc.nextInt ();
    
int arr[][] = new int[m][n];
    
for (int i = 0; i < m; i++)
      
for (int j = 0; j < n; j++)
	
arr[i][j] = sc.nextInt ();
    
 
int max = Integer.MIN_VALUE;
    
int index = -1;
    
for (int i = 0; i < m; i++)
      
      {
	
int sum = 0;
	
for (int j = 0; j < n; j++) { sum = sum + arr[i][j]; } System.out.println ("Row " + (i + 1) + " : " + sum); if (sum > max)
	  
	  {
	    
max = sum;
	    
index = i + 1;
	  
}
      
}
    
 
System.out.println ("Row " + index + " is having the maximum sum : " +
			   max);
  
}

}

Q) Problem Statement

You are required to implement the following function:
Int SumNumberDivisible(int m, int n);

The function accepts 2 positive integer ‘m’ and ‘n’ as its arguments.
You are required to calculate the sum of numbers divisible both by 3 and 5, between ‘m’ and ‘n’ both inclusive and return the same.

Note
0 < m <= n

Example
Input:
m : 12
n : 50
Output   90

Explanation:
The numbers divisible by both 3 and 5, between 12 and 50 both inclusive are
{15, 30, 45} and their sum is 90.

Sample Input

m : 100
n : 160

Sample Output

510

C PROGRAM 
/* Programming Question */
#include <stdio.h> 
int Calculate(int, int);
int main()
{
    int m, n, result;
    // Getting Input 
    printf("Enter the value of m : ");
    scanf("%d",&m);
    printf("Enter the value of n : ");
    scanf("%d",&n);
    result = Calculate(n,m);
    // Getting Output
    printf("%d",result);
    return 0;
}
/* Write your code below . . . */
int Calculate(int n, int m)
{
// Write your code here
    int i, sum = 0;
    for(i=m;i<=n;i++)
    {
        if((i%3==0)&&(i%5==0))
        {
            sum = sum + i;
        }
    }
return sum;
}
C++ PROGRAM 

#include <iostream
#include <cstring>
int main() {
char str[100];
char toSearch[100];
int count;
int i, j, found;
int stringLen, searchLen;

std::cin.getline(str, 100);
std::cin >> toSearch;

stringLen = strlen(str);
searchLen = strlen(toSearch);
count = 0;

for (i = 0; i <= stringLen - searchLen; i++) {
found = 1;
for (j = 0; j < searchLen; j++) {
if (str[i + j] != toSearch[j]) {
found = 0;
break;
}
}
if (found == 1) {
count++;
}
}

std::cout << count;
return 0;
}

JAVA PROGRAM 
import java.util.*;
class Main 
{
    public static int sumNumberDivisible(int m,int n)
    {
        int sum=0;
        for(int i=m;i<=n;i++)
        {
            if((i%3==0)&&(i%5==0))
            {
                sum=sum+i;
            }
        }
        return sum;
    }
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        int m=sc.nextInt();
        int n=sc.nextInt();
        int res=sumNumberDivisible(m,n);
        System.out.println(res);
    }
}
PYTHON PROGRAM 
str = input()
toSearch = input()

stringLen = len(str)
searchLen = len(toSearch)
count = 0

for i in range(stringLen - searchLen + 1):
    found = True
    for j in range(searchLen):
        if str[i + j] != toSearch[j]:
            found = False
            break
    if found:
        count += 1

print(count)

Follow regularly our Dailyrecruitment.in site to get upcoming all up-to-date information.

JOB ALERT ON INSTAGRAM FOLLOW NOW>>
JOB ALERT ON TELEGRAM JOIN NOW>>

Govt Jobs by Qualifications

Education & Vacancies Salary Apply Link
10th Pass Govt Jobs - 5,000 Vacancies Rs. 5,200 - 63,200 Apply Now
12th Pass Govt Jobs - 18,000+ Vacancies Rs. 5,200 - 92,300 Apply Now
ITI Pass Jobs - 3,500 Vacancies Rs. 5,200 - 35,000 Apply Now
Any Graduate Jobs - 19,100 Vacancies Rs. 5,200 - 92,300 Apply Now
Central Govt Jobs Rs. 5,200 - 17,000 Apply Now
Bank Jobs - 1,000 Vacancies Rs. 5,200 - 29,200 Apply Now
Diploma Jobs - 9,300 Vacancies Rs. 5,200 - 35,000 Apply Now
BTech/BE Jobs - 18,000 Vacancies Rs. 15,000 - 1,00,000 Apply Now
Data Entry Jobs - 1,300 Vacancies Rs. 5,200 - 29,200 Apply Now
Private Jobs Rs. 10,000 - 67,700 Apply Now