Pages

Get a Number from user and print its table using function

Friday, 19 April 2013

#include<stdio.h>

#include<conio.h>
int table(int ta, int b);
int main()
{

    int number,a;
    printf("Enter a number: ");
    scanf("%d",&number);
    for(a=1;a<=10;a++){
    printf("%d * %d = %d \n", number, a, table(a, number));
    } //function call
    getch();
}
int table(int ta, int b)
{
    //int a;
    //for(a=1;a<=10;a++)
    return b*ta;
}

 

Search Box

Most Reading

Contact Form

Name

Email *

Message *