Wipro All Placement Papers PDF 1 30

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Wipro Elite National Talent

Hunt 2019 – FAQs

Q1. Am I eligible for Elite National Talent Hunt 2019?


A.  Education:
 10th Standard: 60% or above
 12th Standard: 60% or above
 Graduation: 60% or CGPA Equivalent to 60% or above as applicable by the
university guidelines
 Year of Passing: 2019 ONLY
 Qualification: B.E./B. Tech / 5 years Integrated-M. Tech
 Branch of Study: All Streams
 Other Criteria:
 Maximum of 3 years of education gap, if any, is allowed between 10th and
graduation.
 Should be from a Full-time Degree course recognized by the Central/State
Government of India.
 All Arrears and backlogs need to be cleared at the time of selection process.
 Should have completed all exams/ viva-voice/ training and should not have
any pending attendance requirement with the college.
 Candidates who have participated in any selection process held by Wipro in
the last six months are not eligible.
Q2. What is reference number/ resume number/ registration number?
Reference number/ resume number/ registration number is an eight-digit registration
number unique to every candidate. It will be created once you have completed first
A.
stage of registration process. Same will be sent to you via email notification. Please
retain the same for all future communications.

Q3. Which password must I enter while logging in?


Please use the password you have received over email from [email protected].
A.
Kindly check your spam emails as well.

Q4. How do I login on the Candidate Desktop?


Please go to: https://synergy.wipro.com/campus/cd/ using the credentials and
A.
password sent to your Wipro registered email address.

I am a 2019 pass out but I have registered under 2018 Off Campus Engineering
Q5.
Event. How do I apply for Elite National Talent Hunt?
Please share your reference number with [email protected]. If eligible,
A. you will receive an email notification to participate in the event.

Q6. My candidate details already exist. What should I do?


Please check your email from [email protected] for Resume number/ password
A.
and try logging in again.

I have registered for another event for Wipro campus hiring? How do I apply for Elite
Q7.
National Talent Hunt?
Please share your reference number with [email protected]. If eligible,
A. you will receive an email notification to participate in the event.

Q8. I am facing account lockout/ password related issues. What should I do?
A.
Change Password- Using this feature, the candidate can
modify the password by submitting resume number, old
password, new password and confirm new password.

Rest Password- When the candidate desktop is locked,


candidate must submit resume number and click on ‘Reset
password’. New system-generated password will be sent
to the registered email address within 30 minutes.

Forgot Password - By clicking on this icon, the Candidate


will receive an email mentioning the password details.

Update Email Address - By clicking on this icon, candidate


can update their email address by submitting resume
number, date of birth, current email address and the new
email address.
It throws an error ‘Database already exists’- I have never applied with Wipro earlier.
Q9.
What should I do?
Please share the resume number which prompts on your Candidate desktop while
A.
applying with us. We will get back to you shortly.

I have updated incorrect details (gender, date of birth, score in 10th/ 12th/
Q10. graduation) while registering for Elite National Talent Hunt. How can I update the
same?
Please share your reference number with manager.campus@wipro with supporting
A. documents attached. We will update the details from back-end within three working
days.

Q11. I have backlogs. Am I still eligible to participate in Elite National Talent Hunt?
A. No, candidates must not have any backlogs at the time of selection process.

I am from Mechanical engineering background? Am I still eligible to participate in Elite


Q12.
National Talent Event? Will there be a different test conducted?
Elite National Talent Hunt is open to Engineering Graduates from all engineering
A. streams. Test will be common for all candidates. Please check additional eligibility
criteria on https://careers.wipro.com/elite-nth.aspx.

Q13. I have passed out in 2018. May I still apply for Elite National Talent Hunt?
A. Elite National Talent Hunt is open to Engineering candidates graduating in 2019 only.

Q14. What should I enter under ‘Branch’ tab of 10th & 12th standard?
Branch is not applicable for 10th. Please mention ‘NA’. For 12th, please mention your
A.
stream as applicable.

Q15. I am pursuing MCA. Am I eligible for Elite National Talent Hunt?


ONLY Engineering Graduates passing out in the year 2019 will be eligible. Further
A.
eligibility criteria have been mentioned on https://careers.wipro.com/elite-nth.aspx.

I am unable to see three options under Preferred Location section of CAM form?
Q16.
What should I do?
A. Please delete your browser cache and log in again.
Disclaimer:

The parameters and procedure of selection solely depend upon Wipro's discretion. Wipro is
not liable to disclose any information at any stage of the selection process. Wipro also
reserves the right to roll back any provisional offer if the provisionally selected candidate
does not meet the specified conditions which are prerequisite to being boarded. Wipro also
reserves the right to hold any provisionally candidate liable if he/she is proved to be involved
in any illegal activity for instance: misrepresentation, fraud, production of illegal documents
etc.

Wipro shall inform the candidates the results of the hunt; either selection or non-selection
through the personal email ids or another mode of communication as provided by the
respective candidates.
Wipro has not empaneled any third party for conducting recruitment drive, requisite training,
collecting fees or any other processes as envisaged under this program. Also, it is to be
noted that Wipro does not charge any fee at any stage of this program. Likewise, only those
registrations stand valid which are made at Wipro's official recruitment website. Any
communication claimed to made on Wipro’s behalf by any third party are to be considered as
misrepresentation and an attempt to defraud and therefore, the same should be ignored.
Wipro does not hold any responsibility towards such unauthorized communication made or
believed by any.
Wipro National Level Talent Hunt Test
All you need to know about it

Contact Details:
Call/ Message: +91 9108870101
Email: [email protected]
Wipro National Hunt Test – 2019 Pass-outs

• Looking at 8000+ Recruits this year


• Opportunity for Non-Accredited Colleges, Colleges prove then they
will look at re-aligning the accreditation status.
• Wipro looking at great coding skills to deploy them within 1-2 weeks
internal training period
• Saurabh Govil – President & Chief HRO –
– Increased Fresher’s Salary – 3.5 from 3.2 LPA
– Hiring will increase by 25-30% compared to last year
• 3 Tier- Campus Outreach
– Star Colleges like IITs – 12 Lakhs Package
– Turbo Programme – 6.5 to 7 Lakhs Package
– Traditional College recruits

©Focus 4-D Career Education Pvt. Ltd


Contact Details: Call/ Message: +91 9108870101 Email: [email protected]
Eligibility Criteria for the Test

• 2019 Pass-Outs
• OnlyB.E./B.Tech are eligible
• Must have 60% or above in 10th / 12th and Graduation
• Should belong to the following branches
• – CS/ IT/ ECE/ EEE/ E&I/ Mechanical/ Automobile/ Production Engineering/
Aeronautical/ Mechatronics
• Role is to work as Project Engineer
• Salary of INR 3.20 or 3.30 lacs per annum
• Others - Must be a graduate with Full-time Degree course recognized by the Central/State
Government of India.
• No standing Backlogs
• No pending exams or attendance shortage.

©Focus 4-D Career Education Pvt. Ltd


Contact Details: Call/ Message: +91 9108870101 Email: [email protected]
Process to Apply for Wipro National Qualifier Test
2018

– Registration Start Date : Nov 1st week – Colleges TPOs and


Career Tab will get the links & Details by first week of Nov

– Exam Date : 16th ,17th and 18th of November - Nodal Centers


have already got emails regarding their host , others are receiving it
soon.

©Focus 4-D Career Education Pvt. Ltd


Contact Details: Call/ Message: +91 9108870101 Email: [email protected]
Wipro – AMCAT Pattern
Number of
Round 1 (online) Duration
Questions
Quants
Logical 45 30
Verbal
Round 2
Writex 20 1
Round 3
Coding 45 2

©Focus 4-D Career Education Pvt. Ltd


Contact Details: Call/ Message: +91 9108870101 Email: [email protected]
Section Wise Questions and Time Allocation for
the Wipro National Qualifier Test
Wipro National
Time Alloted Difficulty of Perecentile
Qualifier Test No of Questions
(in mins) Questions Needed
Sections

Written and 1 20 mins Medium 60 percentile


Communication

Verbal and 30 45 mins Med-High 60 percentile


Analytical Test

Programming 2 45 mins Easy-Medium 60 percentile


Automata

Internal Division in Verbal And Analytical Sections

Time Alloted
Section Name No of Questions Difficulty Percentile
(mins)

Reasoning 10 15 High 60 percentile

English 10 15 Medium 60 percentile

Aptitude 10 15 Medium 60 percentile

©Focus 4-D Career Education Pvt. Ltd


Contact Details: Call/ Message: +91 9108870101 Email: [email protected]
Why FACE for Wipro

• Out of 174 Engineering colleges visited by Wipro , 138 are clients of FACE
• Presence across the country and exhaustive Wipro client list experience with this FY
recruitments
• Proven track record this year
• 70-75% Question repetition (Science of repetition concept)
• Concept level pedagogy approach with hot questions alone
• Mock tests for time management & practice
• Any update on the pattern/questions at the later stage, we will own and do the additional
patch work later on a VA basis

©Focus 4-D Career Education Pvt. Ltd


Contact Details: Call/ Message: +91 9108870101 Email: [email protected]
Our Offerings

• Variant A - 10 Days
– Aptitude – 7 Days – Hot Questions alone (Science of repetition concept)
– Write – X – 1 Day
– Technical Automata Coding – 2 Days

• Variant B – 7 Days
– Aptitude – 4 Days – Hot Questions alone (Science of repetition concept)
– Write – X – 1 Day
– Technical Automata Coding – 2 Days

• Variant C – 4 Days
– Aptitude – 2.5 Days – Hot Questions alone (Science of repetition concept)
– Write – X – 0.5 Day
– Technical Automata Coding – 1 Day
©Focus 4-D Career Education Pvt. Ltd
Contact Details: Call/ Message: +91 9108870101 Email: [email protected]
Wipro Placement Question  
 Papers PDF Computer

QUANTS- 
Topics  Subtopics  Expected Questions 

Basic Mathematics  ● Divisibility  6 - 8 Questions 


● HCF and LCM 
● Numbers, decimal fractions 
and power 

Applied  ● Profit & Loss ,Simple &  8 - 10 Questions 


Mathematics  Compound Interest 
● Time, Speed and Distance 
● Work & Time 
● Ration & Allegation 

Engineering  ● Logarithms  8 - 10 Questions 


Mathematics  ● Permutation and 
Combinations 
● Probability 

 
 

COMPUTER Programming 
Topics  Subtopics  Expected Questions 

Basic Programming  ● Data Types  10 - 12 Questions 


● Iteration, Recursion, Decision 
● Procedure, functions and scope 

Data Structures  ● Arrays, Linked Lists, Trees, Graphs  6 - 8 Questions 


● Stacks, Queues 
● Hash Tables 
● Heaps 

OOPs  ● Polymorphism  4 - 6 Questions 


● Abstraction 
● Encapsulation 
Miscellaneous  ● Searching and Sorting  4 - 5 Questions 
● Complexity Theory 
● Core Computer Science 

 
 

ENGLISH 
 

Topics  Subtopics  Expected 


Questions 

Vocabulary  ● Synonyms  7 - 8 Questions 


● Antonyms 
● Sentence based Synonyms 
● Sentence based Antonyms 

Grammar  ● Subject-Verb Agreement  10 - 12 


● Tenses and Articles  Questions 
● Prepositions and Conjunctions 
● Speech and Voices 

Comprehension  ● Inferential and Literal Comprehension  5 Questions 


● Contextual Vocabulary 
● Comprehension ordering 

 
 

 
 

LOGICAL REASONING 
Topics  Subtopics  Expected Questions 
Deductive Reasoning  ● Coding deductive logic  5 Questions 
● Blood Relation 
● Directional Sense 
● Objective Reasoning 
● Selection decision tables 

Inductive reasoning  ● Analogy and Classification  5 Questions 


pattern recognition 
● Coding pattern and Number 
series pattern recognition 

Abductive Reasoning  ● Logical word sequence  6 Questions 


● Data sufficiency 

 
 

Question 1. There is a colony of 8 cells arranged in a straight line where each day every cell 
competes with its adjacent cells (neighbour). Each day, for each cell, if its neighbours are both 
active and both inactive, the cell becomes inactive the next day, otherwise it becomes active the 
next day. 
Assumptions: The two cells on the ends have single adjacent cell, so the other adjacent cell can 
be assumed to be always inactive. 
Even after updating the cell state. Consider its previous state for updating the state of other 
cells. Update the cell information of all cells simultaneously. 
Write a function cell Compete which takes one 8 element array of integer’s cells representing the 
current state of 8 cells and one integer days representing the number of days to simulate. 
An integer value of 1 represents an active cell and value of 0 represents an inactive cell. 
Existing Program 
int* cellCompete(int* cells,int days) 
{/ 
/write your code here 

//function signature ends 
Test Cases 
TESTCASES 1: 
INPUT: 
[1,0,0,0,0,1,0,0],1 
EXPECTED RETURN VALUE: 
[0,1,0,0,1,0,1,0] 
  
TESTCASE 2: 
INPUT: 
[1,1,1,0,1,1,1,1,],2 
EXPECTED RETURN VALUE: 
[0,0,0,0,0,1,1,0] 
 

Solution​: 
#include<iostream> 
using namespace std; 
int cellCompete(int *cells ,int day){ 
//write your code here 
for (int i=0;i<day;i++){ 
cells[-1]=0; //assumptions 
cells[8]=0;//assumptions 
int u[8]; //another array to copy value 
for (int i=-1;i<9;i++){ 
u[i]=cells[i]; 

for(int j=0;j<8;j++){ 
if(u[j-1]==u[j+1]){ //comparing the value of the neighbouring cells of u[] 
cells[j]=0; //changing value of cell according to condition 

else 
cells[j]=1; 
} }  
for (int i=0;i<8;i++){ 
cout<<cells[i]; 

return 0;} 
int main(){ //main function 
int days,cells[]={1,0,0,0,0,1,0,0}; //array to pass through function 
int *cellsptr=cells; //creating array values to pointer 
cout<<"enter days:"; //for days 
cin>>days; 
cout<<"n[1,0,0,0,0,1,0,0]n"; 
cellCompete(cellsptr, days); //passing to function 
return 0; 

 

Question 2.  

Mooshak the mouse has been placed in a maze. There is a huge chunk of cheese somewhere in 
the maze. The maze is represented as a two-dimensional array of integers, where 0 represents 
walls.1 represents paths where Mooshak can move and 9 represents the huge chunk of cheese. 
Mooshak starts in the top left corner at 0. 
Write a method is Path of class Maze Path to determine if Mooshak can reach the huge chunk 
of cheese. The input to is Path consists of a two dimensional array and for the maze matrix. The 
method should return 1 if there is a path from Mooshak to the cheese. And 0 if not Mooshak is 
not allowed to leave the maze or climb on walls. 

 
EX: 8 by 8(8*8) matrix maze where Mooshak can get the cheese. 
1 0 1 1 1 0 0 1 
1 0 0 0 1 1 1 1 
1 0 0 0 0 0 0 0 
1 0 1 0 9 0 1 1 
1 1 1 0 1 0 0 1 
1 0 1 0 1 1 0 1 
1 0 0 0 0 1 0 1 
1 1 1 1 1 1 1 1 

 
Test Cases:  
Case 1: 
Input:[[1,1,1,][9,1,1],[0,1,0]] 
Expected return value :1 
 
Explanation: 
The piece of cheese is placed at(1,0) on the grid Mooshak can move from (0,0) to (1,0) to reach 
it or can move from (0,0) to (0,1) to (1,1) to (1,0) 
Test case 2: 
Input: [[0,0,0],[9,1,1],[0,1,1]] 
Expected return value: 0 

 
Explanation: 
Mooshak cannot move anywhere as there exists a wall right on (0,0) 

 
Existing Program 
/*include header files needed by your program 
some library functionality may be restricted 
define any function needed 
function signature begins, this function is required*/ 
Int isPath(int **grid,int m,int n) 
{/* 
write your code here 
*/} 
/function signature ends  

 
Solution​: 
if (x,y outside maze) return false 
if (x,y is goal) return true 
if (x,y not open) return false 
mark x,y as part of solution path 
if (FIND-PATH(North of x,y) == true) return true 
if (FIND-PATH(East of x,y) == true) return true 
if (FIND-PATH(South of x,y) == true) return true 
if (FIND-PATH(West of x,y) == true) return true 
unmark x,y as part of solution path 
return false*/ 
public boolean findPath(int x, int y){ 
// check x,y are outside maze. 
if(x < 0 || x >= mazelength || y < 0 || y >= mazelength ){ 
return false; 

if(maze[x][y] == 9) { 
return true; 

if(maze[x][y] != 1) return false; 
//mark x, y as part of the solution path 
if(maze[x][y] == 1){ 
maze[x][y] = 3; 

// move North 
if( findPath(x-1,y)){ 
return true; 

//move East 
if( findPath(x,y+1)) return true; 
//move South 
if( findPath(x+1,y)) return true; 
//move West 
if( findPath(x,y-1)) return true; 
// unMark x,y as part of the solution. 
maze[x][y] = 0; 
return false; 

public void printSolution(){ 
System.out.println("Final Solution ::::::: "); 
for(int i=0;i<mazelength;i++){ 
for(int j=0;j<mazelength;j++){ 
System.out.print(" "+maze[i][j]+" "); 

System.out.println(); 


public static void main(String args[]){ 
RatMazeProblem ratMazeProblem = new RatMazeProblem(); 
System.out.println(" is Path exist ::: "+ratMazeProblem.findPath(0,0)); 
ratMazeProblem.printSolution();    


 

Question 3. The least recently used (LRU) cache algorithm exists the element from the 
cache(when it’s full) that was least recently used. After an element is requested from the cache, 
it should be added to the cache (if not already there) and considered the most recently used 
element in the cache. 

 
Initially, the cache is empty. The input to the function LruCountMiss shall consist of an integer 
max_cache_size, an array pages and its length Len 
The function should return an integer for the number of cache misses using the LRU cache 
algorithm. 
Assume that the array pages always have pages numbered from 1 to 50. 
TEST CASES: 

 
TEST CASE1: 
INPUT: 
3,[7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0],16 
EXPECTED RETURN VALUE: 
11 

 
TESTCASE 2: 
INPUT: 
2,[2,3,1,3,2,1,4,3,2],9 
EXPECTED RETURN VALUE: 

 
EXPLANATION​: 
The following page numbers are missed one after the other 2,3,1,2,1,4,3,2.This results in 8 page 
misses. 
Existing Program 
int lruCountMiss(int max_cache_size, int *pages,int len) 
{/ 
/write tour code 

 

Solved Program 
#include<iostream.h> 
using namespace std; 
int lruCountMiss(int max_cache_size, int *pages,int len) 

int miss=0,cache[max_cache_size]; /*variable miss and cache declared*/ 
for (int i=0;i&lt;max_cache_size;i++){ 
/*this is for clearing value of cache i.e. to empty cache. I used any value here*/ 
cache[i]=0x87787; 

for (int i=0;i&lt;len;i++){ /*for loop for all the value from list one by one*/ 
for(int j=0;j&lt;max_cache_size;j++){ 
/*loop to check the cache value, if it matches the value*/ 
if (pages[i]==cache[j]){ 
for (int k=i; k&lt;max_cache_size;k++){ 
/*if the value is already present in the cache then shifting values from the present value.*/ 
cache[i]=cache[i+1]; 

cache[max_cache_size-1]=pages[i]; /*updating the last value of cache*/ 
break; 

else if(j==(max_cache_size-1)){ 
for (int l=0; l&lt;max_cache_size;l++){ 
/*if the value is not present in the cache then shifting values from starting.*/ 
cache[l]=cache[l+1]; 

cache[max_cache_size-1]=pages[i]; 
/*updating the last value of cache*/ 
miss++; 

}} 
return miss;}/*returning the Miss*/ 
int main(){ /*main function*/ 
cout&lt;&lt; "We are checking two cases.\n"&lt;&lt;"Case 1:t"&lt;&lt;"Array values are 
[7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0] nand cache size= 3; and total values to check are 16: n We got the 
miss. "; 
int days,pages[]={7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0}; 
/*array to pass through function*/ 
int *cellsptr=pages; 
/*creating array values to pointer*/ 
cout&lt;&lt;"Miss =t"&lt;&lt;lruCountMiss(3,cellsptr,16);//passing to function 
cout&lt;&lt;"nnCase 2:t"&lt;&lt;"Array values are [2,3,1,3,2,1,4,3,2] nand cache size= 2; and total 
values to check are 9: n We got the miss. "; 
int pages2[]={2,3,1,3,2,1,4,3,2}; 
int *cellsptr2=pages2; 
/*creating array values to pointer*/ 
cout&lt;&lt;"Miss =t"&lt;&lt;lruCountMiss(2,cellsptr2,9);//passing to function 
return 0; 

 

Ques. 4 Write a function to insert an integer into a circular linked _list whose elements are sorted 
in ascending order 9smallest to largest). The input to the function insert Sorted List is a pointer 
start to some node in the circular list and an integer n between 0 and 100. Return a pointer to the 
newly inserted node... 
The structure to follow for a node of the circular linked list is 
Struct CNode ; 
Typedef struct CNode cnode; 
Struct CNode 
{I 
nt value; 
Cnode* next; 
};C 
node* insertSortedList (cnode* start,int n 
{/ 
/WRITE YOUR CODE HERE 
}/ 
/FUNCTION SIGNATURE ENDS 
  
Test Case 1: 
  
Input: 
[3>4>6>1>2>^],5 
Expected Return Value: 
[5>6>1>2>3>4>^] 
Test Case 2: 
  
Input: 
[1>2>3>4>5>^],0 
Expected Return Value: 
[0>1>2>3>4>5>^] 
Given the maximum size of the cache and a list of integers (to request from the cache), 
calculate the number of cache misses using the LRU cache algorithm. A cache miss occur when 
the requested integer does not exist in the cache. 

Solution 

Cnode* insertSortedList (cnode* start,int n) 



int count=1,i,count1=0; 
 
Cnode* temp=start; 
Cnode* temp1=start; 
Cnode* temp2=start; 
Cnode* newHead=NULL; 
 
// One principle with circular linked list is that ->next is never NULL 
while(temp!=NULL) 

temp=temp->next; 
count ++; 

 
int arr[count]; // you can declare a dynamic array this way, toy need to use apointer and malloc 
// One principle with circular linked list is that there is no need to copy it to insert a new 
element somewhere 
arr[0]=n; 
while(temp2!=NULL) 

for(j=1;j<count;j++) 

arr[j]=temp->data; 
temp2=temp2->next; 


 
// wrong logic here 
while(n>=temp2->value) 

temp2=temp2->next; 

 
newHead=temp2; 
 
for(i=0;i<count;i++) 

Cnode* newNode=new Cnode(); 
 
newNode->data=arr[i]; 
newNode->next=NULL; 

return newNode; 

 

Or 

Cnode* insertSortedList (cnode* start,int n) 



int count=1,i,count1=0; 
 
 
Cnode* temp=start; 
Cnode* temp1=start; 
Cnode* temp2=start; 
Cnode* newHead=NULL; 
 
while(temp!=NULL) 

temp=temp->next; 
count ++; 

 
int arr[count]; 
 
while(temp2!=NULL) 

for(j=0;j<count;j++) 

arr[j]=temp->data; 
temp2=temp2->next; 


 
 
while(n>=temp2->value) 

temp2=temp2->next; 

 
newHead=temp2; 
 
for(i=0;i<count;i++) 

Cnode* newNode=new Cnode(); 
 
newNode->data=arr[i]; 
newNode->next=NULL; 

 

 
 

Question 5. Removal of vowel from string 


#include <stdio.h> 
#include <string.h> 
  
int check_vowel(char); 
  
int main() 

char s[100], t[100]; 
int i, j = 0; 
  
printf("Enter a string to delete vowels\n"); 
gets(s); 
  
for(i = 0; s[i] != '\0'; i++) { 
if(check_vowel(s[i]) == 0) { //not a vowel 
t[j] = s[i]; 
j++; 


  
t[j] = '\0'; 
  
strcpy(s, t); //We are changing initial string 
  
printf("String after deleting vowels: %s\n", s); 
  
return 0; 

  
  
int check_vowel(char c) 

switch(c) { 
case 'a': 
case 'A': 
case 'e': 
case 'E': 
case 'i': 
case 'I': 
case 'o': 
case 'O': 
case 'u': 
case 'U': 
return 1; 
default: 
return 0; 

Question 6. GCD of two numbers. 

#include <stdio.h> 
  
// Recursive function to return gcd of a and b 
int gcd(int a, int b) 

// Everything divides 0  
if (a == 0 || b == 0) 
return 0; 
  
// base case 
if (a == b) 
return a; 
  
// a is greater 
if (a > b) 
return gcd(a-b, b); 
return gcd(a, b-a); 

  
// Driver program to test above function 
int main() 

int a = 98, b = 56; 
printf("GCD of %d and %d is %d ", a, b, gcd(a, b)); 
return 0; 

Or 

class Test 

// Recursive function to return gcd of a and b 
static int gcd(int a, int b) 

// Everything divides 0  
if (a == 0 || b == 0) 
return 0; 
   
// base case 
if (a == b) 
return a; 
   
// a is greater 
if (a > b) 
return gcd(a-b, b); 
return gcd(a, b-a); 

   
// Driver method 
public static void main(String[] args)  

int a = 98, b = 56; 
System.out.println("GCD of " + a +" and " + b + " is " + gcd(a, b)); 

Question 7. Eliminate repeated elements in Array. 

Solution -  

#include<stdio.h> 
  
int main() { 
int arr[20], i, j, k, size; 
  
printf("\nEnter array size : "); 
scanf("%d", &size); 
  
printf("\nAccept Numbers : "); 
for (i = 0; i < size; i++) 
scanf("%d", &arr[i]); 
  
printf("\nArray with Unique list : "); 
for (i = 0; i < size; i++) { 
for (j = i + 1; j < size;) { 
if (arr[j] == arr[i]) { 
for (k = j; k < size; k++) { 
arr[k] = arr[k + 1]; 

size--; 
} else 
j++; 


  
for (i = 0; i < size; i++) { 
printf("%d ", arr[i]); 

  
return (0); 

 

OutPut -  

 
Enter array size : 5
Accept Numbers : 1 3 4 5 3
Array with Unique list : 1 3 4 5

C program to print reverse Pyramid star pattern


Example

Input

Input rows: 5
Output

*********
*******
*****
***
*

Logic to print reverse pyramid star


pattern

You might also like