This blog consists of C and C++ programs. C and C++ programming is the basics to learn any programming language. Most of the programs are provided with their respective outputs. This blog also contains Data Structures programs using Object-Oriented Programming (C++). Some of the best books for learning C and C++ programming are also mentioned.

Tuesday 6 August 2013

Program to find the length of the string using strlen() function

#include<stdio.h>
void main()
{
char str[50];
int len;
clrscr();
printf("Enter the text: ");
scanf("%s", str);
len=strlen(str);
printf("Length of the string = %d", len);
getch();
}


1 comment: