0% found this document useful (1 vote)
2K views

TCS Ninja Most Repeated Questions From Past Years

walked at 3, then the total time taken would have been: 1) TCS is a large Indian IT company and subsidiary of TATA group. It a. 12 hours b. 9 hours c. 10 hours d. 8 hours provides IT services, consulting, and business solutions. 2) The document describes a sample placement process for TCS with Answer: a sections on English, quantitative aptitude, coding, and an interview. It includes details like number of questions and duration for each section. Q14. A bag contains 5 red balls and 3 blue balls. Two balls are drawn randomly without replacement. Find the probability that both balls are 3)

Uploaded by

Aditya Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
2K views

TCS Ninja Most Repeated Questions From Past Years

walked at 3, then the total time taken would have been: 1) TCS is a large Indian IT company and subsidiary of TATA group. It a. 12 hours b. 9 hours c. 10 hours d. 8 hours provides IT services, consulting, and business solutions. 2) The document describes a sample placement process for TCS with Answer: a sections on English, quantitative aptitude, coding, and an interview. It includes details like number of questions and duration for each section. Q14. A bag contains 5 red balls and 3 blue balls. Two balls are drawn randomly without replacement. Find the probability that both balls are 3)

Uploaded by

Aditya Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

TCSN18-14

at Rs. 70 per kg, making a profit of 20%. What was the ratio of the Answer: a
mixture?
About TCS
a. 1:10 b. 3:8 c. 1:5 d. 2:7
TCS is an Indian multi-national company that provides information Answer: c Q8. a,b, c chosen randomly and with replacement from the set
technology services, consulting and business solution company. It is a {1,2,3,4,5}, the probability that a * b + c is even.
subsidiary of TATA group and is one of the biggest and most a. 1/2 b.64/125 c. 59/125 d.2/5
Q2. Jake can dig a well in 16 days. Paul can dig the same well in 24 Answer: c
prominent mass recruiter.
days. Jake, Paul and Hari together dig the well in 8 days. In how many
Placement process for Ninja
days Hari alone can dig the well?
No. of Q9. Find the number of zeros in the expression 15 x 32 x 25 x 22 x 40 x

questions: 10 a. 32 days b. 48 days c. 96 days d. 24 days 75 x 98 x 112 x 125.


English
Total duration: Answer: b a. 9 b.7 c. 14 d.12
10 minutes
Standard Answer: a
Q3. There is a set of 39 distinct points on a plane with the following

(15 questions) No. of


characteristics:
Quantitative Advanced questions: 20 Q10. In how many ways can 7 different objects be divided among 3
Aptitude (5 questions). Total duration: * There is a subset A consisting of eight collinear points.
persons so that either one or two of them do not get any object?
May include FITB 40 minutes * Any subset of three or more collinear points from the 39 are a
National a. 36 b.180 c.381 d.84
Qs subset of A.
Qualifier Answer: c
Standard How many distinct triangles with positive area can be formed with
Test*
(7 questions) No. of each of its vertices being one of the 36 points? (Two triangles are said

Programming Advanced (3 questions: 10 to be distinct if at least one of the vertices is different) Q11. Ratio of the radii of the cylinder to the cone is 1:2. Assume, their
Concepts questions) May Total duration: a. 9083 b. 9139 c. 8215 d. 4495 heights are the same. Find the ratio of their volumes.
include FITB Qs 20 minutes a. 3:4 b.1:2 c. 1:4 d.4:1
Answer: a
Answer: a
No. of
Coding (C, C++, Java, Python, questions: 1 Q4. An ant smartly moves across a staircase taking the shortest
PERL) Total duration: distance. Calculate the distance it takes to reach the top to B from A Q12. Which of the following numbers must be added to 5678 to give
20 minutes given that staircase consists of 2 steps. It is also known that the length, remainder of 35 when divided by 460?
Technical and HR interview breadth and height is 6 cm, 1cm and 1cm respectively. a. 980 b. 797 c. 955 d. 618

* Additional info to note – Q1. Easha bought two varieties of rice, costing Rs 50 per kg and Rs. a. 2√25 b. √52 c. √7 d. 9
1. Negative marking for MCQ, no negative marking for FITB Qs 60 per kg each and mixed them in some ratio. Then she sold the Answer: b
2. Sectional cutoff applicable, including on sub sections mixture
(Advanced)
Q5. Roshan is proud of his Swiss Watch that he got as birthday gift from
3. Performance in advanced sections crucial to interview
his father. Roshni like teasing her brother and on one occasion she said
selection as well as possible jump to TCS Digital role.
“what is there with a costly watch. The reflex angle between the hands
are the same in yours and mine”. If the time was 11:20, then what was
Expectation from a student
the reflex angle?
English 1. Know basic grammar rules
2. Understand the usage of grammar rules and a. 200 b. 310 c. 140 d.290
words Answer: c
3. Identify the context of the
sentence/paragraph and decide on Q6. Divide 50 into two parts, such that the sum of their reciprocals is
appropriate word/order that fits with the 1/12.
context of the sentence/paragraph
a. 25, 25 b. 10, 40 c. 20, 30 d.290
Aptitude Proficient in numeric problem solving
Technical MCQ Basic know of C, Data structures and Algorithms Answer: c
Coding Able to write basic programs
Q7. Three containers A, B and C are having mixtures of milk and water in
the ratio of 1:5, 3:5, 5:7 respectively. If the capacities of the containers
Quantitative Aptitude
are in the ratio 5:4:5, find the ratio of milk to water, if all the three Answer:b
containers are mixed together.
a. 53:115 b. 53:113 c. 54:115 d. 54:113 Q13. George walks 36 kms partly at a speed of 4kms per hour and
partly at 3 kms per hour. If he had walked at a speed of 3kms per
hour when he had walked at 4 and 4 kms per hour when he had
walked at 3 he would have walked only 34 kms. The time (in hours)
spent by George walking was:
a. 8 b. 12 c. 5 d. 10
Answer: d

Q14. The sum of four consecutive two-digit odd numbers, when


divided by 10, becomes a perfect square. Which of the following
can possibly be one of these four numbers?
a. 67 b. 41 c. 25 d. 31
Answer: b

Q15.In how many ways a team of 11 must be selected from 5 men


and
11 women such that the team comprises of not more than three
men?
a.1234 b. 1565 c. 2456 d. 2256
Answer: d
TCSN18-14

Q15. 4 men throw a die each simultaneously. Find the probability that 656D Q4. ABCDEFGH is a regular octagon. A and E are opposite vertices of
at least 2 people get the same number. a.121 b. 129 c.116 d. 127 the octagon. A frog starts jumping from vertex to vertex, beginning
a. 5/18 b. 13/18 c. 1/36 d. 1/2 Answer: a from A. From any vertex of the octagon except E, it may jump to either
of the two adjacent vertices. When it reaches E, the frog stops and
Answer: b Q23. After 6 years Raju’s father’s age will be twice that of his age and stays there. Let an be the number of distinct paths of exactly n jumps
2 years ago, his mother’s age was twice that of Raju’s age. What is the ending in E. Then what is the value of a2n-1?
Q16. There are 10 points on a straight line AB and 8 on another sum of Raju’s parents’ age? a. 0 b. 4 c. 2n -1 d. Cannot be determined
straight line AC none of them being point A. How many triangles can a. 4 less than four times Raju’s age Answer: a
be formed with these points as vertices? b. 2 more than four times Raju’s age
a.680 b. 720 c. 816 d. 640 c. 4 more than four times Raju’s age Q5. Consider obtuse-angled triangles with sides 8 cm, 15 cm and x cm.
Answer: d d. 2 less than four times Raju’s age If x is an integer then how many such triangles exist?
Answer: c a. 5 b. 21 c. 10 d. 15
Q17. How many 7-digit telephone numbers can be formed with 6 and Answer: c
5 at the right and left extreme ends respectively?
Advanced Aptitude
a.2160 b. 720 c. 4320 d. None of these English
Answer: d
Q1. 1 red flag, 3 white flags and 2 blue flags are arranged in a line Questions 1 to 4
such that: Fill in the blanks with suitable words.
Q18. In how many ways a cricketer can score a double century (200
I. No two adjacent flags are of the same colour
runs) with only boundaries (fours) and over boundaries (sixes)? New industries supported by foreign interests Q1_ offer better
II. The flags at the ends are of 2 different colours.
a.15 b. 16 c. 17 d. 18 salaries to their employees at all levels of responsibility than
In how many different ways the flags be arranged? Q2_ locally-owned industries. They need talented people and
Answer: c a. 6 b. 4 c. 10 d. 2 are willing to pay high wages to retain them. Local industries often
Answer: a Q3_ against the high salaries offered by foreign supported
Q19. If all the numbers between 11 and 100 are written on a piece of industries, arguing that this will unreasonably raise all wages to an
paper, how many times will the number ‘4’ be used? excessive level. Workers in local industries, seeing the sharp Q4_
Q2. In the figure AB = BC = CD = DE = EF = FG= GA. Then angle DAE is in job-pay will agitate for an improvement in their salaries. This
a. 20 b. 19 c. 9 d. None of these
approximately: eventually will drain the resources and lower their profitability.
Answer: b E

G C
Q1
Q20. P, Q, R, S are distinct integers that can take values from 1 to 12.
a. hardly b. reluctantly c. seldom d. usually
What is the possible smallest value for (P/Q) + (R/S)?
Answer: d
a. (1/12) + (2/11) b.( 1/11) + (9/10) A B F D
c.( 1/11) + (2/12) d.( 1/10) + (1/11)
Q2
Answer: a a. 15° b. 20° c. 30° d. 25°
a. did b. could c. do d. their
Answer: d
Answer: d
Q21. A alone can finish the work in 10 hours, B alone can finish the

Q3
work in 12 hours and C alone can finish the work in 15 hours. A, B and Q3. A farmer has decided to build a wire fence along one straight line
C together started working at 11’o clock. After 2 hours A leaves. When a. uphold b. imitate c. protest d. pay
of his property. For this he planned to place several fence-posts at 6m
will B & C will together will finish the work? intervals, with posts fixed at both ends of the side. After he bought the Answer: c
a.4’ o clock b. 5’0 clock posts and wire, he found that the number of posts he had bought was
c.4:20 d. 5:20 five less than required. However, he discovered that the number of Q4
Answer: c posts he had bought would be just sufficient if he spaced them 8m a. difference b. cut c. hike d. decrease
Q22. In the simple subtraction problem below some single digits (not apart. What is the length of the side of his property and how many Answer: a
necessarily distinct) are replaced by letters. Find the value of 6*A + posts did he buy?

5*B + 2*C*D? a. 100m, 15 b. 100m, 16 Questions 5 to 8


A1C5 c. 120m, 15 d. 120m, 16 Fill in the blanks with suitable words.
- 1B67 Answer: d
When she appeared on the screen without Q5 , cosmetic sales
2
TCSN18-14

declined. When she played a nun, convent enrolments Q6 . B. "To James Morrisson, M.R.C.S., from his friends of the C.C.H.," C. But the technology adopted has been largely of foreign origin.
Letters were delivered to her addressed simply “Ingrid Bergman”. was engraved upon it, with the date "1884." D. There are, however, areas such as atomic energy, space,
Industrialist Howard Hughes once _Q7 every available air tickets C. It was a fine, thick piece of wood, bulbous-headed, of the sort agriculture and defence where significant strides have been
from New York to Los Angeles to be sure she would accept a seat in his
which is known as a "Penang lawyer." made in evolving relevant technologies within the country.
private plane. An Q8 walked a sheep all the way from Sweden

to Rome as a gift for her. D. It was just such a stick as the old-fashioned family practitioner a. ADCB b. DBAC c. BACD d. CBAD
used to carry--dignified, solid, and reassuring. Answer: c
Q5 E. I stood upon the hearth-rug and picked up the stick which our
a. shoes b. hat c. gloves d. make-up visitor had left behind him the night before. Q14
Answer: d F. Just under the head was a broad silver band nearly an inch A. Central planning has failed the world over.
across. B. Hope cannot be dropped from helicopters.
Q6 a. AECFBD b. ABCEDF C. The people, especially in remote areas, must have the power and
a. increased b. decreased c. FDBAEC c. FBAECD resources to script their future.
c. lessened d. indifferent Answer: a D. It needs to be built though good governance at the local level.
Answer: d a. BDAC b. ACBD c. BCDA d. DABC
Q11 Answer: a
Q7 A. Not unlike most other Asian countries, Indian children are
a. brought b. bought socialized into a system where they are expected to obey and Questions 15 to 17
c. sold d. boarded respect authority figures without ever questioning their actions. Select the word which is closest in meaning to the stem word.
Answer: b B. An all pervasive sensibility that rebellion is a sign of bad
upbringing breeds a culture of abuse by encouraging sexual Q15. Receptacle
Q8 a. Dissipation b. Dispersal
predators.
c. Repository d. Leak
a. administrator b. accomplice C. Two adults in India are often seen to exercise a near feudal hold
Answer: c
c. acrobat d. admirer over children demanding their unquestioned and complete
Answer: b obedience.
D. The reasons for the rampant instances of sexual abuse in India Q16. Tumult
are manifold and rooted deep within the country’s social fabric. a. Truce b. Bedlam c. Peace d. Concord
Questions 9 to 13
Choose the most logical order of sentences among the given choices a. DABC b. ABDC c. DBAC d. CBAD Answer: b
to construct a coherent paragraph. Answer: a
Q17. Infuriate
Q9.
Q12 a. Exasperate b. Placate c. Comfort d. Soothe
A. Their entire philosophy is based on the recognition that all men
are made by nature to be equals, therefore no one has a natural A. This is problematic both theoretically and practically, because it Answer: a
right to govern others, and therefore the only justified authority has grave consequences for the way society views and treats the
is the authority that is generated out of agreements or fundamental issues of women’s lives. Questions 18 to 20
covenants. B. Crimes such as these against any group other than women would Select the word which is farthest in meaning to the stem word.
B. The social contract theorists recognised the need to have an be recognized as a civil and political emergency as well as a gross Q18. Odious
agency for the protection of man and his property.
violation of the victims’ humanity. a. abhorrent b. palatable
C. Therefore, this period built on the concept of an individual,
inalienable rights as maintainable in a collective whole. C. Significant numbers of the world’s population are routinely c. infamous d. munificent
D. What was built on did not lead to the advocation of the creation subject to torture, starvation, terrorism, humiliation, mutilation, Answer: b
of a sovereign state though. and even murder simply because they are female.
a. DBCA b. DCBA c. BACD d. BADC D. Yet, despite a clear record of deaths and demonstrable abuse, Q19. Dole
Answer: c women’s rights are not commonly classified as human rights. a. amass b. dispute c. mete d. canvass
a. BACD b. DACB c. ADBC d. CBDA
Answer: a
Q10 Answer: d
A. Mr. Sherlock House, who was usually very late in the mornings,
save upon those not infrequent occasions when he was up all Q20. Tractable
Q13
night, was seated at the breakfast table. a. hale b. tenacious c. incalcitrant d. obedient
A. There is a strong manufacturing base for a variety of products.
Answer: c
B. India has come a long way on the technology front.

3
TCSN18-14

a. they are disregarded by conventional weather forecasts because c. an extraordinary high percentage of its students fails to gain
Questions 21 to 23 they are thought to be too small admission to higher education
Select the lettered pair that best expresses a relationship similar to b. they are disregarded by conventional weather forecasts because d. a high percentage of its students, extraordinarily high in fact,
that expressed by the original pair. these waves are thought to be too small fails to gain admission to higher education
c. conventional weather forecasts disregard them because they Answer: b
Q21. THWART : ABET :: think they are too small
a. strip : befit b. lacerate : incise d. conventional weather forecasts disregard these waves because
c. savor : enjoy d. murmur : caterwaul they are thought to be too small
Programming Concepts
Answer: d Answer: d Q1. Memory allocation using malloc() is done in?
a. static area b. Heap area
Q28. In archaeological terms the university was a latecomer to the c. stack area d. disc
Q22. CUPOLA : ROOF ::
a. branch : tree b. building : story town, which was already centuries old by the time we first hear of the Answer: b
c. airplane : propeller d. statue : pedestal establishment of a community of scholars and teachers in the late
Answer: d 12th Century. Q2. What will be the output of the below program?
a. which was already centuries old by the time we first hear of the int main()
establishment of {
Q23. CHECKERS : CHESS ::
b. already centuries old by the time we first hear of its int i= 10;
a. tennis : soccer b. field hockey : ice hockey
establishment of i = ! i > 14;
c. hearts : bridge d. square : diamond
c. which was centuries old already when we first hear of the printf( "%d", i );
Answer: c
establishment of return 0;
d. that was already centuries old by the time we first hear that they }
Questions 24 to 26 had established a. 1 b. Runtime error
Identify the part of the sentence which contains error(s). c. compilation error d. 0
Answer: a
Q24. Many middle class individuals (A) /find that they cannot get good Answer: d
medical attention (B) /despite they need it badly (C) /because of the
Q29. The recent photographs of the giant squid are remarkable Q3. What will be the output of the below program?
high cost of treatment. (D)
because they show these enormous living creatures as moving around #include<stdio.h>
a. A b. B c. C d. D
in their natural environment, whereas previous pictures have been of int main()
Answer: c {
only dead animals.
a. because they show these living creatures as moving around in printf("%.0f", 5.89);
Q25. Amphibians are creatures which (A)/ live equally effortlessly (B)/ their return 0;
in water and land are found (C)/ in all the countries of the world. (D) b. in that they show this most enormous of living creatures moving }
a. A b. B c. C d. D around in its a. 0 b. 5 c. 6 d. 5.89
Answer: c c. in that they show this enormous living creature moving around Answer: c
in its
Q26. Anbuselvan leads a content life (A)/ with his relatives in his d. because these enormous living creatures are shown to be Q4. What is the use of void pointer?
village (B)/ and rarely visits the city, though (C)/ he has many friends moving around in their a. Pointer that will not return any value
here. (D) Answer: c b. Address of any variable of any data type can be assigned
a. A b. B c. C d. D c. Address of void method can be stored
Answer: a Q30. A teacher at the school acknowledged that despite government- d. Address of another pointer can be stored
sponsored endeavours to improve classroom performance, an Answer: B
Questions 27 to 30 extraordinary high percentage of their students fail to gain admission
Choose the option which can best replace the underlined part: to higher education. Q5. If malloc() fails to allocate the requested memory, it returns
Q27. Inertia-gravity waves cause characteristic stripy patterns in the a. an extraordinary high percentage of their students fail to gain a. Null
clouds in the lower atmosphere but they are disregarded by admission to higher education b. Garbage Value
conventional weather forecasts because they are thought to be too b. an extraordinarily high percentage of its students fail to gain c. Zero
small to interact with larger systems such as warm and cold fronts. admission to higher education d. None of the Mentioned

4
TCSN18-14

Answer: a for(y=1;y<=x;y++) a. write(1,"hello world",11)


{ b. puts("hello world");
printf("%d\n",y); c. system(“echo 'hello world'”)
Q6. What will be the output of the below program? } d. All of the mentioned
#include<stdio.h> } Answer: d
int x = 5; }
void main() a. 15 b. 11 c. 10 d. 13
Q15. What will be the output/error?
{ Answer: a int main()
int x = 3; {
m(); Int i=5;
Q9. Which is true?
printf("%d" , x); char c='c'; int
} a. Local variable is always static
sum=i+c;
void m() b. Global variables are equal to auto variable printf("%d",sum);
{ c. Both are true return 0;
x = 8; d. None of the mentioned }
n(); a. 104 b. 103 c. Error d. -121
} Answer: d
void n() Answer: a
{ Q10. What will happen if in a C program you assign a value to an array
printf("%d", x); element whose subscript exceeds the size of array? Q16. What is the use of ‘&’ operator in C?
} a. The element will be set to 0. a. used as pointer b. gives the size of the variable
a. 3 8 b. 8 3 c. 8 5 d. 8 b. The compiler would report an error. c. give address d. All of the mentioned
Answer: b c. The program may crash if some important data gets overwritten. Answer: c
d. The array size would appropriately grow.
Answer: d Q17. Which one of the following is true?
Q7. What will be the output of the below program? a. Local variable is always static
#include<stdio.h> Q11. What is the difference between declaration and definition of a b. Global variables are equal to auto variable
long int fact(int n); variable? c. Both are true
int main() a. Declaration specifies the properties and definition specifies the d. None of the mentioned
{ block of executable statements Answer: d
// missing statment b. Declaration declares a variable& variable definition defines its
} type Q18. Where are the local variables stored?
long int fact(int n) c. declaration specifies the properties and definition causes the a. Stack b. Queue c. Heap d. Hard disk
{ storage to be allocated. Answer: a
if(n>=1) d. None of the mentioned
{ Answer: c Q19. What will be the output/error?
return n * fact( n-1 ); int main()
} Q12. What is the format of conditional operator? {
else a. Condition? true_value: false_value printf("%.0f", 5.89);
{ b. Condition! true_value: false_value return 0;
return 1; c. Condition? false_value: true_value }
} d. Condition? true_value: false_value a. 0 b. 5 c. 6 d. 5.890000
}
Answer: a Answer: c
a. printf("%ll\n",fact(5)) b. printf("%u\n", fact(5))
c. printf("%d\n", fact(5)) d. printf("%ld\n", fact(5)) Q13. Accessibility of local and global is and . Q20. What is the use of void pointer?
Answer Option : d a. Within the function, Within the block a. Pointer that will not return any value
Q8. How many times the below loop will be executed? b. Within the function, to all functions b. Address of any variable of any data type can be assigned
c. Within the block, Within the function c. Address of void method can be stored
#include<stdio.h> d. None of the mentioned d. Address of another pointer can be stored
int main() Answer: b Answer: b
{
int x, y;
Q14. Print a string without using printf() or putchar() function. Which
for(x=5;x>=1;x--)
of the following will be used?
Coding
{
String: “hello world”

5
TCSN18-14

Q1. Write a Program to print whether the given alphabet is vowel or #include <stdio.h> }
consonant int main() { printf("No perfect couple found!");
Solution: char c; }
scanf("%c", &c);
#include<stdio.h>

// Upper to lower case Q5. Write a program to find the most occurring character in the
int main()
if('A' <= c && c <= 'Z') string.
{
{ Solution:
// Get the character
printf("%c", 'a' + (c - 'A')); #include <stdio.h>
char ch;
} #define MAX_SIZE 100
scanf("%c", &ch);
// Lower to upper case #define MAX_CHARS 26
if(ch >= 'A' && ch <= 'Z')
if('a' <= c && c <= 'z') int main()
{
{ {
ch = 'a' + (ch - 'A');
printf("%c", 'A' + (c - 'a')); int i;
}
} //Get a sentence
if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
return 0; char str[MAX_SIZE];
{
} scanf("%[^\n]s", str);
printf("Vowel");
Q4. Given an array and a number (say s), find whether any two // Init Freq stoting array
}
elements in the array whose sum is “s”. int freq[MAX_CHARS];
else
Solution: for(i=0; i<MAX_CHARS; i++)
{
#include<stdio.h> {
printf("Consonant"); #include<stdlib.h> freq[i] = 0;
}
void check_sum_and_diplay(int arr[], int size, int sum); }
return 0;
int main() // Frequency of each character is counted
}
{ for(i = 0; str[i] != '\0'; i++)
Q2. Write a program to Check whether a given number is a prime // Get the size of an array {
number or not int size; int isAlphabet = 0, offset;
Solution: scanf("%d", &size); if(str[i] >= 'a' && str[i] <= 'z')
// Get the array elements {
#include <stdio.h>
#include<math.h> int arr[50], i; isAlphabet = 1;
int main() for(i=0; i<size; i++) offset = str[i] - 'a';
{ }
{
int n, i, flag = 0; scanf("%d", &arr[i]); else if(str[i] >= 'A' && str[i] <= 'Z')
//printf("Enter a positive integer: "); } {
scanf("%d",&n); // Get the sum value (to check with an array elements) isAlphabet = 1;
for(i=2; i<=sqrt(n); ++i) int sum; offset = str[i] - 'A';
scanf("%d", &sum); }
{
// condition for nonprime number // Function call to check the sum of any two elements in an array if(isAlphabet == 1)
if(n%i==0) equal to given sum {
// and display the same freq[offset] += 1;
{
flag=1; check_sum_and_diplay(arr, size, sum); }
break; return 0; }
} } // If two characters occurred the same number of time then
} void check_sum_and_diplay(int arr[], int size, int sum) // print lowest ASCII value character.
{ int max_index = 0;
int i,j; for(i=0; i<MAX_CHARS; i++)
if (flag==0)
for(i=0; i<size-1; i++) {
printf("%d is a prime number.",n);
{ if(freq[i] > freq[max_index])
else
for(j=i+1; j<size; j++) {
printf("%d is not a prime number.",n);
{ max_index = i;
return 0;
if(sum == (arr[i] + arr[j])) }
}
{ }
printf("Perfect couple: %d %d", arr[i], arr[j]); int max_repeated_char = 'a' + max_index;
Q3. Write a program to change the case of the given alphabet and
print. exit(0); printf("%c", max_repeated_char);
} return 0;
Solution:
} }

You might also like