C examples for Function:Function Definition
Define and use variable in your own function
#include <stdio.h> void dropBomb(void); /* prototype */ int main()// w w w . j a v a 2s.co m { printf("Press Enter to drop the bomb:"); getchar(); dropBomb(); printf("Yikes!\n"); return(0); } void dropBomb() { int x; for(x=20;x>1;x--) { puts(" *"); } puts(" BOOM!"); }