employer cover photo
employer logo
employer logo

Servion Global Solutions

Est-ce votre entreprise ?

Question d’entretien chez Servion Global Solutions

string length for commend line argument.

Réponses aux questions d'entretien

Utilisateur anonyme

12 oct. 2017

#include #include void main(int argc,char *argv[]) { int len; char *ptr; clrscr(); if ( argc != 2) { printf("\n Invalid arguments "); exit(0); } else { ptr=argv[1]; len=0; while ( *(ptr+len) != '\0') { len++; } printf("\n Length is %d",len); } }

4

Utilisateur anonyme

27 sept. 2020

public class strLength { public static void main(String args[]) { String s1="Test"; System.out.println("string length is: "+s1.length()); }}