Answer to Question #210239 in C for Pragadeesh

Question #210239

Write a C program to print the string and its length using functions


1
Expert's answer
2021-06-24T03:35:53-0400
#include<stdio.h>
#include<string.h>

void printstr(char *ptr){
  printf("The String is : %s",ptr);
  int len=strlen(ptr);
  printf("\nLength of String is : %d",len);
}
int main(){
  char str[20]="Hello world!";
  printstr(str);
  return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS