(Most Asked) TCS NQT Coding Questions with Answers (TCS NQT 2020)

Поделиться
HTML-код
  • Опубликовано: 11 ноя 2024
  • 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-t...
    Use Coupon Code "RUclips" to get maximum discount.
    Check Solutions and more code on - prepinsta.com/...
    Imp: Join Whatsapp Notification Group : prepinsta.com/...
    Join Telegram Notification channel : prepinsta.com/...
    TCS All Coding Questions Playlist - • TCS Coding Questions w...
    Video 2 - • TCS Aptitude Questions...
    Video 3 - • (Asked 25 times) TCS N...

Комментарии • 155

  • @PrepInsta
    @PrepInsta  3 года назад

    TCS NQT Online Course - bit.ly/TCS-NQT-and-Ninja-Course

  • @mymotivation4110
    @mymotivation4110 4 года назад +29

    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
      @Saikumar-kb4lf 4 года назад +7

      It should be "&&" instead of "||"

    • @thomaspgeorge4339
      @thomaspgeorge4339 4 года назад +3

      Use '&&' instead of all the '||'

    • @santoshgokul3374
      @santoshgokul3374 4 года назад +2

      @@thomaspgeorge4339 but if we use && then all of the given alphabets must be present right?? in order to make it execute

    • @thomaspgeorge4339
      @thomaspgeorge4339 4 года назад

      @@santoshgokul3374 i thought so too....but I tried running the program and only this gives the right output

    • @santoshgokul3374
      @santoshgokul3374 4 года назад +2

      Yeah man you're right I just tried now 😅😅 thanks

  • @purumaheshwari7896
    @purumaheshwari7896 4 года назад +1

    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

  • @arnabbasu4514
    @arnabbasu4514 4 года назад +9

    For making the 3rd word into uppercase, I can also use the string in-built function - strupr(c)
    It becomes a lot easier

  • @alphatech7647
    @alphatech7647 4 года назад +6

    In easy way if we check b[j]!=a,e,i,o,u.etc in a particular situation

  • @NIDHISHARMA-ep6nc
    @NIDHISHARMA-ep6nc 5 лет назад +3

    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

  • @artipatil4160
    @artipatil4160 5 лет назад +11

    In second part one can use:
    if(b[j]!='a'&&b[j]!='i'&&b[j]!='o'.......)//vowels with logical and operator

    • @aswinramadas8000
      @aswinramadas8000 4 года назад

      @@jsa155 the question says 3 english words right? So i think we shouldnt worry about numbers.

    • @aswinramadas8000
      @aswinramadas8000 4 года назад +1

      @@jsa155 alright, agree with you

  • @EEE--AbhishekNayak
    @EEE--AbhishekNayak Год назад

    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
      @PrepInsta  Год назад

      Join our TA Support Group on Discord, where we will help you out with all your queries:
      prepinsta.com/discord/

  • @jatinsingh5503
    @jatinsingh5503 5 лет назад +4

    I am in prepinsta's safe hands

  • @ashishmishra9662
    @ashishmishra9662 5 лет назад +5

    Thanks for explaining...I was looking forward towards these topic😁

  • @iaashu98
    @iaashu98 5 лет назад +3

    You can use toupper() for last case.

    • @PrepInsta
      @PrepInsta  5 лет назад

      yes you can use that as well

    • @iaashu98
      @iaashu98 5 лет назад

      @@PrepInsta thank you, sir.

  • @divakarkumarjha1171
    @divakarkumarjha1171 4 года назад

    Your concept is really awesome

  • @shubhamchauhan8299
    @shubhamchauhan8299 5 лет назад +1

    We can use else in 2 case with vowel condition.. and we can use tolower function for case 3

  • @hindustanibhau7026
    @hindustanibhau7026 5 лет назад +6

    got placed in tcs because of prepinsta

  • @aakritiadarsh8334
    @aakritiadarsh8334 4 года назад +3

    we can concatenate by strcat(a,b,c);

  • @smtech8087
    @smtech8087 4 года назад +1

    10:13 .........25 of thm r vwls

  • @Shakti9621
    @Shakti9621 4 года назад

    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.

  • @bhagyavyshnavi3452
    @bhagyavyshnavi3452 5 лет назад +1

    well explanation ...

  • @saurabhsable4856
    @saurabhsable4856 5 лет назад +2

    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
      @PrepInsta  5 лет назад +1

      you can use simple c or c++

  • @Durgaprasad-bh7hc
    @Durgaprasad-bh7hc 4 года назад +1

    sir in printf statement there is ampersand symbol(&)

  • @explorelife2418
    @explorelife2418 5 лет назад +1

    Sir we can use scanf() function in exam right??? Or we have to take input through command line arguments??

    • @shahidrizwan6903
      @shahidrizwan6903 5 лет назад +1

      You can take input either way. Both are acceptable.

  • @abhiseksah1972
    @abhiseksah1972 5 лет назад +2

    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
      @PrepInsta  5 лет назад +1

      yes, you can do that as well :)

  • @vikramsingh-hm5pf
    @vikramsingh-hm5pf 5 лет назад +4

    printf("%s%s%s",&a,&b,&c); could we use this statement to concatenate the strings?

  • @gowthamreddy6383
    @gowthamreddy6383 3 года назад

    sir plz make an playlist on tcs ninja coding questions

  • @PrepInsta
    @PrepInsta  5 лет назад

    If you have any question please feel free it ask us in the comment section

    • @akshayraj4964
      @akshayraj4964 5 лет назад

      Plz provide us a concatenation step to get the desired o/p of this question.

    • @akshayraj4964
      @akshayraj4964 5 лет назад

      Or can we use strcat(a,strcat(b,c)); statement for concatenation..is this Will be right??

    • @sushmas7233
      @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
      @padmajaarpu8801 4 года назад

      #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

  • @akshayshukla4358
    @akshayshukla4358 5 лет назад +4

    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
      @zakirjack7064 5 лет назад +1

      command line arguments not in syllabus

    • @sshiv908
      @sshiv908 5 лет назад

      it will be specified in the given question what to use

  • @aakashverma8602
    @aakashverma8602 5 лет назад

    For consonants we can have done with for loop of aeiou only by using ! Operator

    • @PrepInsta
      @PrepInsta  5 лет назад

      Hi,
      Yes, you can also use that as well :)

  • @saquibsid3122
    @saquibsid3122 5 лет назад

    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?

  • @praveensingh5532
    @praveensingh5532 4 года назад +2

    Sir if we use a[i]!='a'||a[i]!='e' instead of writing all the constant letters we can achieve same result

    • @kanurihemasatyasaidurgapraveen
      @kanurihemasatyasaidurgapraveen 4 года назад +1

      Yes! We can but and operator is used instead of or operator 🙂

    • @achyuttokekar9227
      @achyuttokekar9227 4 года назад

      No, because if there are any other characters...instead of alphabet then it will accept them too...

  • @bipashapal9703
    @bipashapal9703 5 лет назад +2

    Is it mandatory to write code in cmd line arguments??

    • @PrepInsta
      @PrepInsta  5 лет назад

      no you can use C, C++, Java perl and python

  • @ruchitasalekar4956
    @ruchitasalekar4956 4 года назад +6

    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
      @neerajk_10 4 года назад

      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)

  • @shivammehta8284
    @shivammehta8284 5 лет назад

    Better use isupper and other methods of c++

  • @buttercupxdd
    @buttercupxdd 5 лет назад +4

    for the 3rd part can't we just use strupr( ) ?

  • @shivangigupta2708
    @shivangigupta2708 5 лет назад

    very well explained

  • @joychakraborty8533
    @joychakraborty8533 5 лет назад +1

    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?

    • @Shakti9621
      @Shakti9621 4 года назад

      yes , i have same doubt

  • @ruchitasalekar4956
    @ruchitasalekar4956 4 года назад

    sir we have to right whole program/code or just have to write only logic or function snippet ?????'
    please clear my doubt.

  • @amanahuja1423
    @amanahuja1423 4 года назад

    Hello sir I have bought your prime course .Was having one query that can we use java for coding questions 1 and 2.

  • @akshatvishwakarma9232
    @akshatvishwakarma9232 5 лет назад

    Sir if our syntax are correct but program is not run due toh error so kuch no milenge thode bht??

  • @rishikeshkumarsingh828
    @rishikeshkumarsingh828 5 лет назад

    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

  • @poojakurhade8672
    @poojakurhade8672 5 лет назад +1

    can you please let me know how to do concatenation so that we get exact o/p mentioned in the question?

    • @dasmala9255
      @dasmala9255 5 лет назад +4

      strcat((strcat(a,b)),c);
      printf("%s",&a);
      After ending of while loop ,write these lines , program will run successfully.

    • @sandeepsandy9456
      @sandeepsandy9456 5 лет назад

      This question concatenation of strings came in InfyTQ exam today

    • @shubhamkechale6940
      @shubhamkechale6940 3 года назад

      @@dasmala9255 thanks..

  • @tamalikaroy2646
    @tamalikaroy2646 4 года назад

    we could have used strupr() func instead nah?

  • @swatisingh4682
    @swatisingh4682 5 лет назад +1

    Is there any online paid course?
    For all basic c language

    • @PrepInsta
      @PrepInsta  5 лет назад

      no there isn't as of yet!

    • @soumyadeepnath6204
      @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.

  • @MohanKumar-vk6xz
    @MohanKumar-vk6xz 5 лет назад +1

    Sir in python the word of vowels cannot replace by that symbol
    Eg: a[i]='%'

    • @iaashu98
      @iaashu98 5 лет назад

      Use escape character

    • @MohanKumar-vk6xz
      @MohanKumar-vk6xz 5 лет назад

      How to use

    • @sandeepk6294
      @sandeepk6294 5 лет назад

      Example:-- ur string is
      s='sandeep'
      For I in range (Len(s)):
      If(s[I]=='a'):
      s.replace(str(s[I]), '@')

    • @sourinbhowmick5971
      @sourinbhowmick5971 4 года назад

      You can also append in to list

  • @soumyadeepnath6204
    @soumyadeepnath6204 5 лет назад +2

    can we use this to check the consonants :
    if(!isalpha(b[i]))

  • @monikaprithivi4250
    @monikaprithivi4250 4 года назад

    In constant part why don't we use not equal to instead of printing all 21 alphabet

  • @wisdombro4655
    @wisdombro4655 4 года назад

    Getting error 'gets' is invalid

  • @keerthanavema7576
    @keerthanavema7576 5 лет назад

    which version of python can be used?2.7 or 3

    • @PrepInsta
      @PrepInsta  5 лет назад +1

      Python 3 will be there in exam

  • @Acoustic_ash
    @Acoustic_ash 3 года назад

    Why did you consider "e" as a consonant 😁

  • @tejsurya6355
    @tejsurya6355 5 лет назад

    Can i know the concepts cut off

  • @er.abhishekgupta195
    @er.abhishekgupta195 5 лет назад

    Video is not cleared properly

  • @RupeshKumar-nm4jx
    @RupeshKumar-nm4jx 5 лет назад

    Sir, the third word is not converted into Uppercase

    • @PrepInsta
      @PrepInsta  5 лет назад

      Hey, please check the code. That you've written because as per our code it is getting convereted.

  • @shaikrizwan5104
    @shaikrizwan5104 5 лет назад

    We want still more methods on it

  • @trendingno.1934
    @trendingno.1934 5 лет назад

    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
      @PrepInsta  5 лет назад +2

      Yes, in our online classes we focus on that itself.

  • @oldcartoonworld1960
    @oldcartoonworld1960 3 года назад

    Technique was not good, the b[j] part could be done in short and easy trick...

  • @hunachigi9824
    @hunachigi9824 5 лет назад

    How to concatanate plz let me know sir

    • @PrepInsta
      @PrepInsta  5 лет назад

      It is your homework its simple and basic just google

    • @dasmala9255
      @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
      @shahidrizwan6903 5 лет назад

      Just print all together

  • @809ritikaraj6
    @809ritikaraj6 3 года назад

    Scored 1297 in aptitude and 51 in programming. M I qualified?

  • @ayushpriyadarshi4049
    @ayushpriyadarshi4049 5 лет назад

    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))

  • @anne_pandey
    @anne_pandey 5 лет назад

    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);
    }
    }

  • @shreyamandal64
    @shreyamandal64 5 лет назад

    can you please give it in java Language?

    • @PrepInsta
      @PrepInsta  5 лет назад

      prepinsta.com/tcs-coding-questions/ you can find the code here

  • @Akshay-jl7os
    @Akshay-jl7os 5 лет назад

    Sir can I update tcs nqt form after 24 July ??

    • @PrepInsta
      @PrepInsta  5 лет назад

      Yes you can update it before hall ticket generation

    • @Akshay-jl7os
      @Akshay-jl7os 5 лет назад

      Thanks sir

  • @divyajain2733
    @divyajain2733 4 года назад

    Sir please send me this code in java...please

    • @charan4002
      @charan4002 4 года назад

      You can find code in prep insta website

  • @ganeshb.v.s1679
    @ganeshb.v.s1679 5 лет назад

    Can I know the aptitude cutoff

  • @sajeedkhans7616
    @sajeedkhans7616 5 лет назад +1

    2nd part worst explanation bro

  • @srinivasareddytelukuntla1305
    @srinivasareddytelukuntla1305 4 года назад

    The way ur explaining is not satisfying

  • @achalmudgal1861
    @achalmudgal1861 5 лет назад

    hlw Atulya sir,.
    i used to message you on your whatsapp no. please reply.

    • @PrepInsta
      @PrepInsta  5 лет назад

      Hey,
      Atulya sir is on leave till tuesday. I think he will reply onc ehe is back.

  • @unnatidua4244
    @unnatidua4244 3 года назад

    Your explanation is just awesome

  • @chandanapriya742
    @chandanapriya742 5 лет назад

    Good explanation