Find String length without using any built in function
#include
#include
void main() {
clrscr();
char s[] = "kartik butani";
int cout = 0;
char st;
do {
st = s[cout++];
}while(st != '\0');
printf("%d",--cout);
getch();
}
#include
void main() {
clrscr();
char s[] = "kartik butani";
int cout = 0;
char st;
do {
st = s[cout++];
}while(st != '\0');
printf("%d",--cout);
getch();
}
Comments
Post a Comment