Pages

Sunday

What We Will be Doing ?



We will be solving the problems related to coding here.I will provide you with the previous year quesions put in TCS and other coding competitions. First we will discuss the questions and you will try to solve them.I am going to provide solutions also


TCS CodeVita, is a contest for engineering and science students to experience the joy of coding and to sharpen their programming skills through real-life computing practices. The contest also aims at identifying the talent, besides providing the student community, an opportunity to earn peer recognition.

TCS Ninja is a National Qualifier Test conducted by TCS (Tata Consultancy Services) in order to recruit candidates from a wide variety of areas. ... Thus, a candidate must have an in-depth knowledge about this exam in order to achieve their dream of working in TCS.

Few Words...Motivation!


There are many candidates aspiring to become engineers but there are very few who really know what it takes to be an engineer. The technology these days is mostly based on knowledge of computer and coding and we all know that the big names in IT sectors while picking up new employees keep there norms and bars high and not everyone can pass it. 

It is because students and engineering colleges focus on bookish knowledge rather than real technical and practical aspects.Under such circumstances student can take online help to catch up to the expectations of technical world. This site is one of few that is helpful for such aspirants. So go on take a look.

wipro coding question

Wipro Coding questions 

1) Find the distinct elements in a given array. (Assume size of an array n<=20)
Sample Input:
  • 9 = size of an array 
  • 2 3 4 5 6 1 2 3 4  =  array elements
Sample Output:
  • 2 3 4 5 6 1
Program:


// C program to print all distinct elements in a given array
#include
void distict_elements(int a[], int n);
int main()
{
int size_array, i, arr[20];
// Get the array size
scanf(“%d”, &size_array)
// Get the array elements
for(i=0; i<size_array; i++)
{
scanf(“%d”, &arr[i]);
}

// Function call to print the distinct elements in an array
distict_elements(arr, size_array);
return 0;
}
void distict_elements(int a[], int n)
{
int i, j;
// Pick all elements one by one
for (i=0; i<n; i++)
{
// Check if the picked element is already printed
for (j=0; j<i; j++)
{
if (a[i] == a[j])
break;
}

// If not printed earlier, then print it
if (i == j)
printf(“%d “, a[i]);
}
}

wipro coding question

2) Program to sort array in ascending & descending order.
Input:
5
8 6 9 2 7
Output:
2 6 7 8 9
9 8 7 6 2
Program:

// C program to sort the given array elements in ascending and
//descending order
#include<stdio.h>
int main(void)
{
int arr[10], i=0, j=0, size, temp;
// Get the size of an array
scanf (“%d”, &size);
// Get the array elements as an input
for (i = 0; i <size; i++)
{
scanf (“%d”, &arr[i]);
}
// Sorting elements in ascending order
for (j=0 ; j<(size-1) ; j++)
{
for (i=0 ; i<(size-1) ; i++)
{
if (arr[i+1] < arr[i])
{
temp = arr[i];
arr[i] = arr[i + 1];
arr[i + 1] = temp;
}
}
}
// Print the elements in ascending order
for (i=0 ; i {
printf (“%d “, arr[i]);
}
printf(“\n”);

// Print the elements in descending order
for (i=size-1; i>=0 ; i–)
{
printf (“%d “, arr[i]);
}
return 0;
}