1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

table of 2 in c programming

Discussion in 'C' started by suraksha, Mar 16, 2011.

  1. suraksha

    suraksha New Member

    Joined:
    Mar 16, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    how can i make table of 2 in c language
     
  2. Ann_beginner

    Ann_beginner New Member

    Joined:
    Apr 10, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    /* with this code you can hav table of any number you wish*/
    Code:
    #include<stdio.h>
    #include<conio.h>
    
    void main()
    {
    	int num,i;
    	clrscr();
    
    	printf("\nENTER THE NUMBER OF WHICH TABLE IS TO BE PRINTED : ");
    	scanf("%d",&num);
    
    	for(i=1;i<11;i++)
    	{
    		printf("\n%d x %2d = %2d",num,i,(num*i));
    	}
    	getch();
    }
     

Share This Page