This function is used for accepting any string until enter key is pressed

This function is used for accepting any string until

This preview shows page 11 - 15 out of 15 pages.

This function is used for accepting any string until enter key is pressed (string will be covered later) Syntax char str[ length of string in number ]; gets(str);
Image of page 11
©LPU CSE101 C Programming #include<stdio.h> void main() { char ch[30]; printf(“Enter the string:”); gets(ch); printf(“Entered string: %s”, ch); } Enter the string: Use of data! Entered string: Use of data!
Image of page 12
©LPU CSE101 C Programming puts() This function prints the string or character array. It is opposite to gets() Syntax char str[ length of string in number ]; gets(str); puts(str);
Image of page 13
©LPU CSE101 C Programming #include<stdio.h> void main() { char ch[30]; printf(“Enter the string:”); gets(ch); puts(“Entered string:”); puts(ch); } Enter the string: puts is in use Entered string: puts is in use We have gone a little far beyond this…because we love PATTERNS!!! Any guesses!!!
Image of page 14
©LPU CSE101 C Programming [email protected] Next Class: Revision
Image of page 15

You've reached the end of your free preview.

Want to read all 15 pages?

  • Spring '18
  • Aman
  • Input device, Input/output, char c

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors