-->

program to display all even numbers lying 1 and 200 using function.

using codeblocks
-----------------------------------------------------------------------------------------
//program to display all even numbers lying 1 and 200 using function.
#include<stdio.h>                      //header file
void even_number();                          // function prototype/declaration with return type zero.
int main()                              //main function
{
even_number();                                     // function calling.
return 0;                                       //returns 0 value
}
void even_number()                              // function body line ; also called function definition
{
 int i;                    // variable declaration
for(i=0;i<=200;i=i+2)       //loop running from 0 to 200 with increment 2 each time
{
    printf("%d\n",i);           // displaying all the numbers
}
     
}

No comments:

Post a Comment