Welcome again

- The Codeclub , smvdu.

Any questions based on previous topics

Today's topic

 

  •  Strings
  •  Questions based on strings

 

What is String ?

String

In computer programming , a String is a sequence of characters.

                or

String is nothing but a character array.

A string is  stored in an array of type char ending with the null character '\0 '

Examples

char  name[10] = "codeclub"

   To print:
printf("%s",name);

//or

for(i=0 ; i!='\0' ; i++){

printf("%c",name[i] );

}
To scan:

char name[10];

scanf("%s",name );

 

To print:

 printf("%s", name );

Write a program to take a string from user as  input and print that string.

Write a program to find the length of a string.

Write a program to calculate the frequency of  a character in a string. ( Take character from user)

Sample Input:

i
​mritunjayvamsi

 

sample output:

Frequency of i is : 2

Write a program to calculate no of vowels and  consonants in a string. 

Sample Input:
  recursion
 
sample output:

No of vowels : 4

No of consonants :  5

Write a program to calculate no of vowels and  consonants in a string. 

Sample Input:
  recursion
 
sample output:

No of vowels : 4

No of consonants :  5

Made with Slides.com