36) C PROGRAM TO FIND THE LENGTH OF STRING
LOGIC:- First take any string , running a loop to until i!='\0' means when until user does not press the enter everything is in string.Now count the everything ,result is come which is the length of string .
2nd WAY:- we can use a function strlen which required header file string.h because it is the function of string.
EXAMPLE:-
LOGIC:- First take any string , running a loop to until i!='\0' means when until user does not press the enter everything is in string.Now count the everything ,result is come which is the length of string .
2nd WAY:- we can use a function strlen which required header file string.h because it is the function of string.
EXAMPLE:-
Comments
Post a Comment