Write a Simple C Function Program that prints the Messages i.e Good Morning? & Good Evening!

Messages

Statement of C Program: This Program prints the Messages i.e Good Morning? & Good Evening! with the help of Function :

This is the Simplest C Function Program. Functions are the basic building blocks of C Program.

#include<stdio.h>
void msg();                                            /* Function Declaration */

int main()
{
msg();                                                         /* Function Call */
printf(" Good Morning?");
return(0);
}

void msg()                                               /* Function Definition */
{
printf(" Good Evening!");
}

 Output:
 Good Evening!
 Good Morning?

Explanation:
Above, we have defined two Functions- main() and msg(). We have used the word msg at three places in the Program. So Let us understood the meaning of each.

1. 
void msg();
This Function declaration indicates that msg() is a Function which after completing its execution does not return anything. The keyword void is used before the msg() to indicate that it 'does not return anything'.

2.
void msg()
{
printf(" Good Evening");
}
This is Function definition. In this definition we are using only printf(), but we can also use for , switch , if , while etc inside Function definition.

3. 
msg();
The Function msg() is being called by main() i.e main() calls the function msg(). We mean that control passes to the function msg().

                                                                       That's All

1 Response to "Write a Simple C Function Program that prints the Messages i.e Good Morning? & Good Evening!"

Popular Posts

Label

1 Sidebar 2 Columns 3 Columns Footer 3rdball 4 Columns Footer Alex Alvaro Antsasia Arlinadesign Averie Barry BASIC CONCEPTS Basil Bayna Fast BeautyPress BeautyTemplates Beckel Best Best - Clean Beyonce Pro BioMag BlackMag Blanter Nova Blogger Card Bloggertheme9 Blogish Bpress Brakt C LANGUAGE C PROGRAMS C++ LANGUAGE C++ PROGRAMS Carella Cellar Charlotte Chooko Lite Clara Clean Combo One Cooperate Crusade Darry Dorman Dreamway Dunia Blanter eCars EduAcademy EducationPress Elise Elvan Eva Everyday FabNews Fashion Fashion Blogger Template Fashion Gossip FastCars Fedo FlashNews Fredy Portfolio Gaming Globus GoodTime Goomsite HTML LANGUAGE iGaming Indicate Innove Insomnia InspiredNews iSoft Jasmine Kalem Landscaping Lashira Lavelle Lily Fashion Limax Linea Lionex Luminescence Lite Lumix Luxury Magazine MagazinePro MAJOR DIFFERENCES MarketingBlog Martin MaxiMag Medica Mega Melissa Mercury MeshMag Minimag Minimalist MiniNews MovieKhor msdesignbd MusicLand Neko NetZine New Spread News16 Newsflash NewsForce NewsIdea Newspaper News NewsPro Nubie Fast Odd Themes Optima PaperMag PaperMag blog Parhlo Perfection Personal Personal Blog Photosout PixelZ Power Blog Premium Themes ProfileMag Purez Rano ReadNews Real estate Remito Grid Responsive Revo Robusta Rotario Saara SeoBoost Settle Shouters Simple Catch SimpleClean Sketchly SNews SolidMag Someo Sophie Sora Sora Bank Sora Home Sora News Responsive Sora One Sora Ribbon Spido Sticko Stucco Sure Mag Swift Tech Tech Pro Techia Techmax TechSpot TemplateClue Templateism Templatesilk Templatesyard Templatezy The Freelancer TheBlogger TheFocus Themeforest Themexpose TIPS AND TRICKS Topside TravelMag Trendy Trendy Travel Tumblr Under Construction Uong Jowo Veethemes Vertox VideoPlay Vigo Waverly way2themes WebBiz Wedding X-Mag Zealer ZetaMag