Solved programming problem

Printing with function in C - 2.

Source code

#include<stdio.h>

void print(char str[]) ///Receive the string

{

   printf("
Your Massage: %s
",str);

}

int main()

{

    char str[100];

    printf("Please Enter A Massage: ");

    gets(str);

    print(str); ///call the function and pass the string

    return 0;

}

Output

Please Enter A Massage: code to haven

Your Massage: code to haven

Join the discussion

Add your comment