Ques2 Wipro Elite NTH Previous Year Coding Questions | Wipro 2022 Batch

Ques2 Wipro Elite NTH Previous Year Coding Questions | Wipro 2022 Batch

Code Bashers

2 года назад

3,479 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@prabalchakraborty1378
@prabalchakraborty1378 - 23.08.2022 17:57

JAVA

public class LastWordLength {
public static void main(String[] args) {
String str = "i am a good student";
int count = 0;
int len = str.length() -1;
for (int i = len ; i > 0 ; i--) {
if (str.charAt(i) == ' '){
break;
}else {
count++;
}
}
System.out.println(count);
}
}

Ответить
@sachinupreti7159
@sachinupreti7159 - 06.11.2021 14:40

If one do it by using inbuilt functions. ,. Then it is allowed to use inbuilt functions in these type of coding exams like TCS, WIPRO, COGNIZABT, IBM, ACCENTURE, INFOSYS, CAPEGMINI.?

Ответить
@theinsanehuman2005
@theinsanehuman2005 - 25.09.2021 13:55

Provide provide the code that run on this type of input " I am the beast not you". Answer would be 5

Ответить
@theinsanehuman2005
@theinsanehuman2005 - 25.09.2021 13:37

If string is "you have more power than me" then is this code give correct result 5 or not

Ответить
@kiritoison28
@kiritoison28 - 22.09.2021 20:02

Hey I got selected for Cognizant GenC Elevate. I would like to share my experience with others. Please do reply 🙂

Ответить