Program to print table of given number using for loop

//Program to print table of given number using for loop
#include<stdio.h>
#include<conio.h>
int main()
{
  int n,j,k;
  clrscr();
  printf("Enter a number\n");
  scanf("%d",&n);
  printf("Table of %d is as\n",n);
  for(j=1;j<=10;j++)
  {
    k=n*j;
    printf(" %d \n",k);
  }

  getch();
  return 0;
}


To Run this Program Copy it in text editor and save as .c
Then double click on it and then it will get opened in your compiler.
Click on run.

8 comments:

  1. C++ program to Print Table of any Number

    Print table of any number in c++ is depend of general concept of generate table of any number, we can multiply any number with 1 to 10.

    ReplyDelete
  2. Print Table of any Number in C++

    Thanks for sharing this code. It is very simple and easy.

    ReplyDelete
  3. Galat hai output shi nhi de rha hai

    ReplyDelete
  4. Write a C program to Print table of entered number by user through keyboard using for loop.

    Code of given problem:
    int main()

    {

    int i=0,num;

    printf("Enter the number to find its table:\t");

    scanf("%d", &num);

    for(i=1;i<=10;i++)

    {

    printf("%d\n",num*i);

    }

    return 0;

    }

    for loop program examples

    Thanks!

    ReplyDelete