Loop is not even required int main() { int n; cin>>n; if(n%2==0) cout
@anuradhashinde50495 жыл бұрын
Sir this same question slove using for(i=1;i
@abhishek0001. Жыл бұрын
complexity will increase as it always cheak if(i==2) or if(i==1) instead you can declare a,b value intially
@PrepInsta5 жыл бұрын
Please feel free to ask questions in the comment section :)
@pallavipriya70575 жыл бұрын
Sir when we put the value of n in odd terms we are getting the output but when we put the value of n in even terms we are getting output as 0
@kandivyshnavi1635 жыл бұрын
does python 2.7 support string related functions
@koushiksai4903 жыл бұрын
In python this can be done as n=int(input()) if n%2!=0: print(n-1) else: print((n/2)-1)
@hindustanibhau70265 жыл бұрын
This question was repeated for me in my TCS Exam, btw I got placed in TCS as well by practising your questions
@iaashu985 жыл бұрын
Congratulations
@bipashapal97035 жыл бұрын
Apoorva Jain do they focus on projects more??
@santoshkumar-ll2kz5 жыл бұрын
Bro have. You taken online classes of prep insta
@pythonenthusiast92924 жыл бұрын
@@bipashapal9703 did you got your answer? I have the same question!
@bipashapal97034 жыл бұрын
@@pythonenthusiast9292 in my interview they asked me about my final yr project..so yeah they may ask about ur final yr project or any project mentioned in ur resume
@RaviPrakash-bo6pe3 жыл бұрын
what about printing sequentially, without making any decisions : import java.util.*; class test{ public static void main(String args[]){ Scanner x = new Scanner(System.in); System.out.print("Enter the size of the sequence : "); int n = x.nextInt(); for(int i=0; i
@abhishek0001. Жыл бұрын
great but some test cases maybe fail
@pavankumarsammath18255 жыл бұрын
Hey i think it can also be solved like this If user entered a odd number return n-1 Else return n/2-1 So 0(1)
@PrepInsta5 жыл бұрын
Yes you’re correct it can also be solved like this
Using for loop make complexity as O(n) We can directly use if else statements it works same Also initialise value of x and y as zero So if that dont hit then it will autumaically print zero at 1 and 2 index
@sushantsingh045 жыл бұрын
1 sep 2019 coding question asked by TCS Xyz company has some employee. The average of some number is five and number 20*3.75/5 is divide by average and formed some integer value number like76 ,74 , 77 , 79
@udayabhaskaran62275 жыл бұрын
n=int(input("enterr the n :")) a=[0,0] i=0 j=1 b=[] while i
@jatinsingh55035 жыл бұрын
This question was asked in July exam - 2019 batch
@abiraja49465 жыл бұрын
The way of explaining is so good. Need aptitude preparation strategy for upcoming tcs drive 2019&2018
@originalgangster78535 жыл бұрын
Good video. Looking forward for more... But, i think videos in online classes are better. It's good that people who are paying money are getting better quality and more videos.
@Alam-nh7mg5 жыл бұрын
Sir,for upcoming off campus driveof TCS which will be held on 1st sept 2019,there is a restriction in coding section solve only by command line programming??
@sohanatarafder99053 жыл бұрын
Sir what will be the python version for TCS nqt for 2021 batch?
@shivangigupta27085 жыл бұрын
Informative video. thanks!
@dipakbarange61775 жыл бұрын
What can be follow different way to solve problem or not
@Aryansingh-fk7hy3 жыл бұрын
Question are only Based on C/C++, or the candidate is given a choice?
@41kaushalchauhan3 жыл бұрын
choice..u can code in ur suitable language like c,c++,java.. python. etc
@sachinmishra42323 жыл бұрын
Sir can we use this code n = int(input()) if (n-1)%2 == 0: print(n-1) else: print((n-1)//2)
@Shinchan-we6ny3 жыл бұрын
I think this will work like a charm🔥👍
@abhishekkarsh66683 жыл бұрын
Yes it will definitely brother.
@MohammedJavid-jz8vi5 жыл бұрын
Thank you sir am getting benefits from your KZbin channel, WhatsApp group also from websites 👏
@PrepInsta5 жыл бұрын
Thank you so much for your nice words
@MohammedJavid-jz8vi5 жыл бұрын
@@PrepInsta sir do we need to write answers along with units in advance apptitiude filling the blanks??
@kanhappyable5 жыл бұрын
sir in java all the functions will be available for coding?
@ramkrishnabhat1983 жыл бұрын
whats the problem with print (a[n-1]) where a is the array and n is the position as per input
@apporvaarya4 жыл бұрын
I knew it...🥰🥰
@balasivannarayanabandi29724 жыл бұрын
Thank you sir
@nithyasreekrishnamoorthy37694 жыл бұрын
I like to join online classes sir. But when I call for the provided support number there is no response.what I should do now sir?
@helalali65553 жыл бұрын
Sir can you solve TCS coding sample questions which is given in the website...please ?
@nitikaraj53975 жыл бұрын
Sir for second if condition why would u take the (n%2!=0)
@pragatikhamkar73773 жыл бұрын
We are storing result of odd values in a and even values in b and User can give odd or even value and to tell the compiler which value is given that's why sir used second if there
@lol-ki5pd4 жыл бұрын
x=int(input()) if x%2==0: print(2*(x//2)) else: print(x//2) Done :P
@rashmipanda8765 жыл бұрын
can you please do a video on permutation of a string
@PrepInsta5 жыл бұрын
Yes, we will do soon :) Thanks for feedback
@sohailshaikh85715 жыл бұрын
I'm from mechanical engineering & will appear for NQT 2020 batch next month... Since I'm from non CS IT background, I'm not too much familiar with coding, but I'm okay with basics like control structures, operators, arrays, strings & structures. Since TCS is conducting only one paper this year for both Ninja and Digital combined... What should I do? Should I just stick to Ninja while applying or should I apply for both? I'm having doubt that, if I apply for both, the level of paper I'll be getting will be tougher, compared to just Ninja paper... Or there will be just one paper? And their evaluation will depend upon our mode of application...
@koustubhumdekar60194 жыл бұрын
if u came to know about tht plz tell me also this year i m going to give nqt also have sm confusion
@smtech80873 жыл бұрын
it's just......b=b+1
@AkashYadav-ve9om5 жыл бұрын
Which version they are providing for coding Python 2 or Python 3?
@PrepInsta5 жыл бұрын
They are going to provide python 3
@adityakardile90293 жыл бұрын
2^0 is 1
@indiawin10005 жыл бұрын
:) proud
@narneceag5 жыл бұрын
Good video. Looking forward for more... But, i think videos in online classes are better. It's good that people who are paying money are getting better quality and more videos.
@PrepInsta5 жыл бұрын
We always strive for making the video !! better and better for students