Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Program to find length of a string.
- #include<conio.h>
- #include<iostream.h>
- #include<stdio.h>
- void main()
- {
- clrscr();
- char a[80];
- cout<<"Enter a string: ";
- gets(a);
- for(int i=0;a[i]!='\0';i++);
- cout<<"The length of the string is: "<<i;
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment