CodesJava

Easy learning with example program codes

C gets() & puts()


C gets() function:

C library facilitates a special function to read a string from a user. This function is represented as gets() function and is defined in the <stdio.h> header file of C.

C puts() function:

C library also facilitates a special function to print a string on the console screen. This function is represented as puts() function and is also defined in the <stdio.h> header file of C.

Example:

#include<stdio.h>  
#include <string.h>  
 
void main()
{    
char day[10];    
printf("Enter current week day: \n");    
gets(day);
 
printf("Today is: ");    
puts(day);  
}

Output

Enter current week day: THURSDAY
Today is: THURSDAY
Posted in C   
Sign Up/ Sign In
Ask a Question


Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at hr@codesjava.com.

Development

We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on hr@codesjava.com.

Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki