#8 | Pointers | Write a program to print the string character-by-character using pointers and find the length of a string.
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFZyk0BYGsypdArYkTYEui1H278UX7uDkXuPYglNOyeZD6ZDCBe2KM4yV7XtLLtJDbFt-VJRuIK_oEZ5rdlbyLMudpbISKy3rP0CylkOoHVl3FvVYmJVGuS7kVLzhW_rNWH_17I3ALZFqemt1ERsQeMKZwbeU9TgBb9OXPsnfL8HyICwT_H5F2UjbM_Q/w290-h252/1596023305925.jpg)
YouTube Video :- Question :- Write a program to print the string character-by-character using pointers and find the length of a string. Code :- /* Write a program to print the string character-by-character using pointers and find the length of a string. */ #include <stdio.h> void main() { // declaring variables char str[ 50 ]; char *s; int len= 0 ; // Collect String From user printf( "Enter any String :- " ); scanf( "%s" ,str); // Assign the memory address to character pointer s = str; //print string character by character while (*s != '\0' ) { // *s is use to take the value that is stored // in given memory address printf( "%c" ,*s); len++; s++; } printf( "\nLength of our String = %d" ,len); } Description :- - In this Program we have to use character pointers. - We have to declare two types of character variables :- - The