Illustration of function prototypes in C

#include <stdio.h>
 
 int main()
 {
    int n;
    void message(int);
 
    printf("Enter a positive integer: ");
    scanf("%d",&n);
    message(n);
    return 0;
 }
 
 void message(int k)
 {
    while(k!=0)
    {
         printf("Message for you:");
         printf("Have a nice day!n");
         k--;
    }
 }
 End Program

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.