c c plus plus java

Tuesday, September 27, 2011

C Program To Find Length Of A String

Variables used
a -Array
l -Lenth
i -Loop control


Program


#include<stdio.h>
#include<string.h>
main()
{char a[100];
int i,l=0;
printf("Enter the string");
gets(a);
for(i=0;a[i]!='\0';i++)
{l=l+1;
}
printf("The length=%d",l);
}
Posted by Blogger at 8:40 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: c program

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2012 (5)
    • ►  March (3)
    • ►  February (2)
  • ▼  2011 (24)
    • ►  December (3)
    • ►  October (3)
    • ▼  September (18)
      • Get Started Basic HTML TAGS
      • PHP Program Syntax
      • Create Database in PHP Mysql
      • Running a PHP Script
      • C Program To Add Two Matrices Using Function
      • C Program To Find Length Of A String
      • C Program To Multiply 2 Matrices
      • C Program To Find Factorial Of A Number Using Recu...
      • C Program To Solve A Quadratic Equation
      • C Program To Convert Decimal To Binary Octal And H...
      • C Program To Find All Prime Numbers From 1 To Infi...
      • An introduction to PHP - Some Basic HTML tags
      • Xampp Free Download And Installation
      • C Program Algorithm To Count Number Of Vowels Blan...
      • C Program For An Exponential Series
      • C Program Read Days And Print In Month Week Day Fo...
      • C Program To Implement Bubble Sort
      • C Program To Find Sum And Average Of N Numbers
Watermark theme. Powered by Blogger.