control loops

while,do while and for statement

Page 1 of 1

2 Replies - 563 Views - Last Post: 08 January 2009 - 10:28 PM Rate Topic: -----

#1 sheina  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-January 09

control loops

Post icon  Posted 07 January 2009 - 11:04 PM

create a program that can make a multiplication table up to 10 only by using while statement, do while statement, and for statement.

#include<stdio.h>
main()
{
int  n=10;
int x,y;
printf("MULTIPLICATION TABLE");
 for(x=1;x<=n; i++){
       for(y=1;y<=n;y++);
           printf("\t%d", x*y);

           }
           printf("\n");
}



** Edit ** :code:

This post has been edited by no2pencil: 08 January 2009 - 10:30 PM


Is This A Good Question/Topic? 0
  • +

Replies To: control loops

#2 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5379
  • View blog
  • Posts: 27,350
  • Joined: 10-May 07

Re: control loops

Posted 07 January 2009 - 11:05 PM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
Was This Post Helpful? 0
  • +
  • -

#3 AmitTheInfinity  Icon User is offline

  • C Surfing ∞
  • member icon

Reputation: 119
  • View blog
  • Posts: 1,563
  • Joined: 25-January 07

Re: control loops

Posted 08 January 2009 - 10:28 PM

This for(y=1;y<=n;y++); should be this for(y=1;y<=n;y++).
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1