(Most Asked) TCS NQT Coding Questions with Answers (TCS NQT 2020)
The most asked type TCS NQT Coding Questions asked in TCS NQT 2020 Exam the whole solution is provided for TCS NQT 2020 Coding Questions with Answers.
TCS NQT Preparation Course - bit.ly/prime-tcs-nqt-course
Use Coupon Code "KZread" to get maximum discount.
Check Solutions and more code on - prepinsta.com/tcs-coding-ques...
Imp: Join Whatsapp Notification Group : prepinsta.com/whatsapp/
Join Telegram Notification channel : prepinsta.com/telegram/
TCS All Coding Questions Playlist - • TCS Coding Questions w...
Video 2 - • TCS Aptitude Questions...
Video 3 - • (Asked 25 times) TCS N...
Пікірлер: 155
TCS NQT Online Course - bit.ly/TCS-NQT-and-Ninja-Course
10:40 there is another way sir. We don't need to write all the consonents in condition we can just upgrade the vowel condition as if(b[j]!='a' || b[j]!='e' || b[j]!='i' || b[j]!='o' || b[j]!='u')
@Saikumar-kb4lf
3 жыл бұрын
It should be "&&" instead of "||"
@thomaspgeorge4339
3 жыл бұрын
Use '&&' instead of all the '||'
@santoshgokul3374
3 жыл бұрын
@@thomaspgeorge4339 but if we use && then all of the given alphabets must be present right?? in order to make it execute
@thomaspgeorge4339
3 жыл бұрын
@@santoshgokul3374 i thought so too....but I tried running the program and only this gives the right output
@santoshgokul3374
3 жыл бұрын
Yeah man you're right I just tried now 😅😅 thanks
Thanks to MHADEV.. If this is not visible on my recommended videos then I can't found this type of explaination.... So simple and easy way... Thanks to Atulya Sir
Your explanation is just awesome
Your concept is really awesome
Thanks for explaining...I was looking forward towards these topic😁
@PrepInsta
5 жыл бұрын
Thank you Ashish
In easy way if we check b[j]!=a,e,i,o,u.etc in a particular situation
Python solution for this problem a,b,c=input("Enter a string:").split() d='' for i in range(0,len(a)): if a[i] in 'aeiou' : d=d+'%' else: d=d+a[i] e='' for i in range(0,len(b)): if b[i] not in 'aeiou': e=e+'#' else: e=e+b[i] f='' for i in range(0,len(c)): if 96
well explanation ...
printf("%s%s%s",&a,&b,&c); could we use this statement to concatenate the strings?
Sir can you make this video in pass the string from command line argument because we will have to take the input using command line argument so please
Hello sir I have bought your prime course .Was having one query that can we use java for coding questions 1 and 2.
In second part one can use: if(b[j]!='a'&&b[j]!='i'&&b[j]!='o'.......)//vowels with logical and operator
@aswinramadas8000
3 жыл бұрын
@@jsa155 the question says 3 english words right? So i think we shouldnt worry about numbers.
@aswinramadas8000
3 жыл бұрын
@@jsa155 alright, agree with you
We can use else in 2 case with vowel condition.. and we can use tolower function for case 3
@shahidrizwan6903
5 жыл бұрын
strupr() or toupper() right?
for checking of consonant character why should we check by 21 characters , if we can use != condition with vowel so we get same result, am i right? bytheway very good explanation, Thankyou.
use != with && operator with all vowels in second condition no need to write all consonants
Sir in tcs nqt coding section...is it compulsory for us for write the code using cammand line arguments or simply we can input it through scanf.. plz help!!
@zakirjack7064
5 жыл бұрын
command line arguments not in syllabus
@sshiv908
5 жыл бұрын
it will be specified in the given question what to use
If you have any question please feel free it ask us in the comment section
@akshayraj4964
5 жыл бұрын
Plz provide us a concatenation step to get the desired o/p of this question.
@akshayraj4964
5 жыл бұрын
Or can we use strcat(a,strcat(b,c)); statement for concatenation..is this Will be right??
@sushmas7233
5 жыл бұрын
{ char *str1; char *str2; str1=strcat(a, b) ; str2=strcat(str1, c) ; printf("%s", &str2) ; return 0; } Is it correct, please do reply!!!
@padmajaarpu8801
3 жыл бұрын
#include Int main( int argc, char **argv) Char **items; Int j=argv; For(i=1;(i%4); i++) Int **p=&items(j); Printf("%c", **p); J--; Return 0; Can any one explain this code with example input
Sir if our syntax are correct but program is not run due toh error so kuch no milenge thode bht??
for NQT 2020...is it compulsory to use command line programming? can't we use simple C or C++....as we are having habits of using them without command line arguments?
@PrepInsta
5 жыл бұрын
you can use simple c or c++
Sir we can use scanf() function in exam right??? Or we have to take input through command line arguments??
@shahidrizwan6903
5 жыл бұрын
You can take input either way. Both are acceptable.
on the 1st part where a[i] ='a' was there you said you are not comparing with ascii values but on the upper case part 'a' how this becomes now ascii?
@programme261
3 жыл бұрын
yes , i have same doubt
Why will i concatenate .......i could just delete the spaces between %s and %s......it would do the work without adding an extra line to the program...... isn't it?
sir in printf statement there is ampersand symbol(&)
For consonants we can have done with for loop of aeiou only by using ! Operator
@PrepInsta
5 жыл бұрын
Hi, Yes, you can also use that as well :)
sir plz make an playlist on tcs ninja coding questions
For making the 3rd word into uppercase, I can also use the string in-built function - strupr(c) It becomes a lot easier
@shubhambhosale8467
3 жыл бұрын
what about in c++
for the 3rd part can't we just use strupr( ) ?
What is the python version for TCS
10:13 .........25 of thm r vwls
Better use isupper and other methods of c++
You can use toupper() for last case.
@PrepInsta
5 жыл бұрын
yes you can use that as well
@iaashu98
5 жыл бұрын
@@PrepInsta thank you, sir.
Good explanation
@PrepInsta
5 жыл бұрын
thank you chandana
sir we have to right whole program/code or just have to write only logic or function snippet ?????' please clear my doubt.
@ruchideharia6438
3 жыл бұрын
Whole compiled and logical program
I am in prepinsta's safe hands
@PrepInsta
5 жыл бұрын
Thanks :) Jatin
@vikramhazra9252
3 жыл бұрын
😂 still stay carefull
we could have used strupr() func instead nah?
In constant part why don't we use not equal to instead of printing all 21 alphabet
16:02 in java we have to just use String.toUpper() method. and whole string will be converted in to upper case. in exam can we use pre-define classes and their methods sir?????? or we are not allowed to use them??? please clear my doubt.
@neerajk_10
3 жыл бұрын
Yes most probably yes. I am saying this because I have used string.h C library in other placement tests (never appeared for TCS though)
can you please let me know how to do concatenation so that we get exact o/p mentioned in the question?
@dasmala9255
5 жыл бұрын
strcat((strcat(a,b)),c); printf("%s",&a); After ending of while loop ,write these lines , program will run successfully.
@sandeepsandy9456
5 жыл бұрын
This question concatenation of strings came in InfyTQ exam today
@shubhamkechale6940
3 жыл бұрын
@@dasmala9255 thanks..
Can i know the concepts cut off
Is it mandatory to write code in cmd line arguments??
@PrepInsta
5 жыл бұрын
no you can use C, C++, Java perl and python
Sir if we use a[i]!='a'||a[i]!='e' instead of writing all the constant letters we can achieve same result
@kanurihemasatyasaidurgapraveen
3 жыл бұрын
Yes! We can but and operator is used instead of or operator 🙂
@achyuttokekar9227
3 жыл бұрын
No, because if there are any other characters...instead of alphabet then it will accept them too...
we can concatenate by strcat(a,b,c);
@robin2binofficialmail844
3 жыл бұрын
No
@mishrithabattiyanda8871
3 жыл бұрын
Can make it this way I guess g=strcat(a, b) ; h=strcat(g, c) ; then print h
@santoshgokul3374
3 жыл бұрын
@@mishrithabattiyanda8871 so this means we can only concatenate only two strings at a time?
can we use this to check the consonants : if(!isalpha(b[i]))
@PrepInsta
5 жыл бұрын
yes you can use that :)
@santoshgokul3374
3 жыл бұрын
What is this bro?
@sahilgaikwad4508
3 жыл бұрын
@@santoshgokul3374 are you preparing for nqt 2021 bro??
@santoshgokul3374
3 жыл бұрын
@@sahilgaikwad4508 yeah man
which version of python can be used?2.7 or 3
@PrepInsta
5 жыл бұрын
Python 3 will be there in exam
Sir in python the word of vowels cannot replace by that symbol Eg: a[i]='%'
@iaashu98
5 жыл бұрын
Use escape character
@MohanKumar-vk6xz
5 жыл бұрын
How to use
@sandeepk6294
5 жыл бұрын
Example:-- ur string is s='sandeep' For I in range (Len(s)): If(s[I]=='a'): s.replace(str(s[I]), '@')
@sourinbhowmick5971
3 жыл бұрын
You can also append in to list
I am from mechanical background . Can u start coding classes from zero . Sir i m not good in coding but ' I WANT ' to be good.
@PrepInsta
5 жыл бұрын
Yes, in our online classes we focus on that itself.
Is there any online paid course? For all basic c language
@PrepInsta
5 жыл бұрын
no there isn't as of yet!
@soumyadeepnath6204
5 жыл бұрын
Refering to Books by C.P.Arora and BalaGuruswami and reading the manual in dev C's "help" section, helped me a lot.
data = [] result = '' for i in range(3): data.append(input("Enter the word ")) print(data) for i in data[0]: if i in ['a','e','i','o','u']: data[0] = data[0].replace(i,'%') else: continue for i in data[1]: if i not in ['a','e','i','o','u']: data[1] = data[1].replace(i,'#') else: continue for i in data[2]: data[2] = data[2].upper() for i in data: result = result + i print(result)
@PrepInsta
11 ай бұрын
Join our TA Support Group on Discord, where we will help you out with all your queries: prepinsta.com/discord/
Getting error 'gets' is invalid
very well explained
@PrepInsta
5 жыл бұрын
Thank you shivangi
Why did you consider "e" as a consonant 😁
Sir, the third word is not converted into Uppercase
@PrepInsta
5 жыл бұрын
Hey, please check the code. That you've written because as per our code it is getting convereted.
Sir can I update tcs nqt form after 24 July ??
@PrepInsta
5 жыл бұрын
Yes you can update it before hall ticket generation
@Akshay-jl7os
5 жыл бұрын
Thanks sir
We want still more methods on it
@PrepInsta
5 жыл бұрын
Will post them soon
got placed in tcs because of prepinsta
@PrepInsta
5 жыл бұрын
Thank you apoorva :)
@SimranSingh-xu8qh
5 жыл бұрын
Hey apurva...m preparing for nqt 2020 can you please help me?
@SimranSingh-xu8qh
5 жыл бұрын
@Apoorva Jain
How to concatanate plz let me know sir
@PrepInsta
5 жыл бұрын
It is your homework its simple and basic just google
@dasmala9255
5 жыл бұрын
@@PrepInsta strcat((strcat(a,b)),c); printf("%s",&a); After ending of while loop ,write these lines , program will run successfully. I think this method is correct. Isn't it?
@shahidrizwan6903
5 жыл бұрын
Just print all together
can you please give it in java Language?
@PrepInsta
5 жыл бұрын
prepinsta.com/tcs-coding-questions/ you can find the code here
Can I know the aptitude cutoff
@PrepInsta
5 жыл бұрын
70%
Video is not cleared properly
Scored 1297 in aptitude and 51 in programming. M I qualified?
@curiouscucumber7162
2 жыл бұрын
did u?
Correct me if i am wrong,if we want to concatenate the words i think simply we can write printf("%s%s%s",a,b,c); Instead of printf("%s %s %s",a,b,c);
@PrepInsta
5 жыл бұрын
yes, you can do that as well :)
Sir please send me this code in java...please
@charan4002
3 жыл бұрын
You can find code in prep insta website
bro instead of using C , you should use JAVA its hardly 8 lines of code for the given problem statement. ---------------------------------------------------------------------- public class LogicalQuestion { public static void main(String[] args) { // TODO Auto-generated method stub String word1,word2,word3; Scanner input = new Scanner(System.in); word1 = input.next(); // reads only one word word2 = input.next(); word3 = input.next(); // Replace all vowel to % word1 = word1.replaceAll("[AEIOUaeiou]", "%"); // Replace all consonants to # word2 = word2.replaceAll("[BCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz]", "#"); // Replace third word to upper case word3 = word3.toUpperCase(); // at last concatenate all the three words System.out.println(word1+word2+word3); } }
Technique was not good, the b[j] part could be done in short and easy trick...
hlw Atulya sir,. i used to message you on your whatsapp no. please reply.
@PrepInsta
5 жыл бұрын
Hey, Atulya sir is on leave till tuesday. I think he will reply onc ehe is back.
2nd part worst explanation bro
If anyone wants to see the code in python: def splitString(newList): #Function to convert the string into list form newA = newList.split(" ") a = how are you , newA =[ "how" , "are" , "you"] return newA def convertString(x): p = [char for char in x[0]] # Traversing character by character in 1st word in list i.e "how" e = ' ' f = ' ' g = ' ' for i in range(0, len(p)): if p[i] == 'a' or p[i] == 'e' or p[i] == 'i' or p[i] == 'o' or p[i] == 'u': p[i] = '%' e += p[i] q = [char for char in x[1]] #Traversing character by character in 2nd word in list i.e "are" for i in range(0, len(q)): if q[i] != 'a' and q[i] != 'e' and q[i] != 'i' and q[i] != 'o' and q[i] != 'u': q[i] = '#' f += q[i] r = x[2].upper() #Converting 3rd word into uppercase g = e + f + r #Concatenating all the 3 word return g a = input("Enter a 3 word String : ") li = splitString(a) print(convertString(li))
@PrepInsta
5 жыл бұрын
great :)
The way ur explaining is not satisfying