Sunday, 21 January 2018

Program for String Length


Program for String Length
#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
char a[10],m,b[10];
clrscr();
printf("input any string\n");

scanf("%s",a);
m=strlen(a);
printf("%d\n",m);
printf("%s",strrev(a));
getch();
                                                              }

Related Posts:

  • Programs In String Handling FunctionsPrograms In String Handling Functions1.Is the folowing program correct or not?   yes/nomain(){  char *str1 = "United";  char * str2 = "Front";  char  *str3;  str3 = strcat(str1, str2); … Read More
  • String Handling Functions In CString Handling Functions In CWith every C compiler a large set of useful string handling library functions are provided. The following figure illustrates the more commonly used functions along with theirpurpose.1.strlen: Fin… Read More
  • Putting Strings TogetherPutting Strings TogetherWe cannot assign one string to another directly We cannot join two strings together by the simple arithmetic addition.       string3 = string1+string2;       str… Read More
  • Array Of Pointers To StringsArray Of Pointers To StringsAs we know , a pointer variable always contains an address. Therefore , if we construct an array of pointers it would contain a number of addresses.Let us see how the names in the earlier example c… Read More
  • Arithmetic Operations On CharactersArithmetic Operations On Characters'C' allows us to manipulate characters in the same way we do with numbers.Whenever a character constant or character variable is used in an expression , it is automatically converted to inte… Read More

0 comments:

Post a Comment