C Programming code for Read & Display Strings – KLETech

Write a Modular C Programming Code for Read & Display Strings | Sentence?

CODE:

#include<stdio.h>
#include<string.h>
void read_sentence(char sentence[]);
void display_sentence(char sentence[]);
main()
{
char sentence[200];
printf("Enter the sentence:\n");
read_sentence(sentence);
display_sentence(sentence);
}

void read_sentence(char sentence[])
{
gets(sentence);
}

void display_sentence(char sentence[])
{
printf("\nThe given sentence is: ");
puts(sentence);
}

 

OUTPUT


Enter the sentence:
Facts Prime gives you the #1 Resources of all the things.

The given sentence is: Facts Prime gives you the #1 Resources of all the things.

Process returned 0 (0x0) execution time : 13.844 s
Press any key to continue.,

 

Please find some more codes of 1D Arrays, 2D Arrays, Pointers on the below page:

Top 100+ C Programming codes – KLE Technological University

 







Leave a Comment

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

Welcome to FactsPrime

Sorry, We have detected that you have activated Ad-Blocker. Please Consider supporting us by disabling your Ad Blocker, It helps us in maintaining this website. To View the content, Please disable adblocker and refresh the page.

Thank You !!!