The Artima Developer Community
Sponsored Link

Java Buzz Forum
C program to print multiplication table using while loop and for loop

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
instanceof java

Posts: 576
Nickname: instanceof
Registered: Jan, 2015

instanceof java is a java related one.
C program to print multiplication table using while loop and for loop Posted: May 14, 2017 8:53 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by instanceof java.
Original Post: C program to print multiplication table using while loop and for loop
Feed Title: Instance Of Java
Feed URL: http://feeds.feedburner.com/blogspot/TXghwE
Feed Description: Instance of Java. A place where you can learn java in simple way each and every topic covered with many points and sample programs.
Latest Java Buzz Posts
Latest Java Buzz Posts by instanceof java
Latest Posts From Instance Of Java

Advertisement
  • Its time to see c program to print multiplication table using while loop or for loop.
  • Its is very easy to print multiplication table using c program
  • We need one for loop which iterates from 1 to 10
  • Inside for loop just multiply numbers and print result in each iteration.
  • Lets us see an example C program on how to print multiplication table using for loop.


Program #1 : Write a c program to print multiplication table using for loop.Take input from user.

  1. #include <stdio.h>
  2. int main()
  3. {
  4.    int n, i;
  5.  
  6.     printf("Enter a Number ");
  7.     scanf("%d",&n);
  8.  
  9.     for(i=1; i<=10; ++i)
  10.     {
  11.         printf("%d * %d = %d \n", n, i, n*i);
  12.     }
  13.      
  14.     getch();
  15.     
  16. }
  
Output:


multiplication table in c program

Program #1 : Write a c program to print multiplication table using while loop


  1. #include <stdio.h>
  2. int main()
  3. {
  4.    int n, i;
  5.  
  6.     printf("Enter a Number ");
  7.     scanf("%d",&n);
  8.     i=1;
  9.     while(i<=10){
  10.                 
  11.         printf("%d * %d = %d \n", n, i, n*i);
  12.         ++i;
  13.     }
  14.      
  15.     getch();
  16.     
  17. }
  
Output:

  1. Enter a Number 
  2. 2
  3. 2 * 1 = 2
  4. 2 * 2 = 4
  5. 2 * 3 = 6
  6. 2 * 4 = 8
  7. 2 * 5 = 10
  8. 2 * 6 = 12
  9. 2 * 7 = 14
  10. 2 * 8 = 16
  11. 2 * 9 = 18
  12. 2 * 10 = 20
     

Read: C program to print multiplication table using while loop and for loop

Topic: 10 Free Java 8 Certification Sample Questions - OCAJP8 and OCPJP8 - 1Z0-808 and 1Z09 dumps Previous Topic   Next Topic Topic: Apache Camel 2.19 Released – Whats new

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use