Q:

C program to print Table of an Integer Number using User Define Function

0

C program to print Table of an Integer Number using User Define Function

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

C program to print Table of an Integer Number using User Define Function

/*  
C program to print Table of an Integer Number 
using User Define Functions.
*/

#include <stdio.h>

/*function declaration*/
void printTable(int);

int main()
{
    int number;

    printf("Enter an integer number: ");
    scanf("%d", &number);

    printf("Table of %d is:\n", number);
    printTable(number);

    return 0;
}

/* function definition...
 * Function     :   printTable
 * Argumenets   :   int- to pass number for table
 * Return Type  :   void
*/
void printTable(int num)
{
    int i;

    for (i = 1; i <= 10; i++)
        printf("%5d\n", (num * i));
}

Output:

    Enter an integer number: 123
    Table of 123 is:
      123
      246
      369
      492
      615
      738
      861
      984
     1107
     1230

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
C program to find Sum of all Array Elements by pas... >>
<< C program to find SUM and AVERAGE of two integer N...