C-Programming Tutorials

C program to Print String

This C program is used to print a string on the screen input by the user.

 

scanf() function is used to obtain input, and printf() function is used to print the string on the screen.

Program:
#include<stdio.h>

main()
{
/* variable definition and initialization */    char stringArray[100];

    printf("Please write something: \n");
    scanf("%s", stringArray);
    
    printf("You enter the string %s\n", stringArray);
    return 0; 101
}
C String Programs (Prev Lesson)
(Next Lesson) C Program to Add n Number of Times
Back to C-Programming Tutorials

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!