Docsity

Printf Command-Computer Fundamentals-Lab Codes, Exercises of Computer Fundamentals

Toggle sidebar
bg1
/*
* Main_prgram.c
*
* This is the Program which has main function and we can called it
* main program.
*
* Created on: Nov 13, 2010
* Author: mohsan
*/
#include <stdio.h> // standard input out
#include "utility.h" // including custom header file
/*
* This is custom print function that only prints integers
*/
void my_print(int x)
{
printf("Number to be printed is %d\n",x);
}
int main()
{
int x=10,y,z=400,max;
// calling square function declared and defined in utility.h and
utility.c
y=square(x);
// calling my_print function declared and defined in Main_program.c
my_print(y);
// calling square function declared and defined in utility.h and
utility.c
max=maximum(x,y,z);
// calling my_print function declared and defined in Main_program.c
my_print(max);
return 0;
}
docsity.com

Partial preview of the text

Download Printf Command-Computer Fundamentals-Lab Codes and more Exercises Computer Fundamentals in PDF only on Docsity!

  • Main_prgram.c
  • This is the Program which has main function and we can called it
  • main program.
  • Created on: Nov 13, 2010
  • Author: mohsan */

#include <stdio.h> // standard input out #include "utility.h" // including custom header file

/*

  • This is custom print function that only prints integers */ void my_print(int x) { printf("Number to be printed is %d\n",x); }

int main() {

int x=10,y,z=400,max; // calling square function declared and defined in utility.h and utility.c y=square(x); // calling my_print function declared and defined in Main_program.c my_print(y);

// calling square function declared and defined in utility.h and utility.c max=maximum(x,y,z); // calling my_print function declared and defined in Main_program.c my_print(max);

return 0;

}

docsity.com