Wednesday, 3 August 2022

c program structure

 

//C program structure

/**                    

// file: age.c             //Documentation

 * author: you

 * description: program to find our age.

 */

#include <stdio.h>      //Link

#define BORN 2000       //Definition

int age(int current);   //Global Declaration

int main(void)          //Main() Function

{

  int current = 2021;     //Local declaration

  printf("Age: %d", age(current));

  return 0;

}

int age(int current)

{         return current - BORN;   //Subprograms

 

}

 

No comments:

Post a Comment