www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/12/05:30:45

From: "Jase" <jase AT lionst DOT u-net DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Newbie(please Help)
Lines: 52
X-Newsreader: Microsoft Outlook Express 4.71.1712.3
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Message-ID: <7Zo22.346$ee1.498299@newsr2.u-net.net>
Date: Wed, 11 Nov 1998 23:17:23 -0000
NNTP-Posting-Host: 195.102.198.60
X-Complaints-To: news AT u-net DOT net
X-Trace: newsr2.u-net.net 910826435 195.102.198.60 (Wed, 11 Nov 1998 23:20:35 BST)
NNTP-Posting-Date: Wed, 11 Nov 1998 23:20:35 BST
Organization: (Posted via) U-NET Internet Ltd.
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Can someone please tell me where i am going wrong with this program i know
its crap but its for college.

thanks
jase AT lionst DOT u-net DOT com

                  /*Progran to produce multiplacation tables*/
#include <stdio.h>
#include <conio.h>
void main(void)
{
float table=0,lines=0,count,total=0;
char end;
do
{
      printf("Enter the times table 0-12  ");
         scanf("%f",&table); /*get times table from user*/
                  while(table>12 || table<0)
                       {
                           printf("\nYou must enter a number between 0-12
");
                           scanf("%f",&table);
                       }

                 printf("\nEnter the number of lines 0-12 ");
                 scanf("%f",&lines);
                   while(lines>12 || lines<0)
                       {
                           printf("\nYou must enter a number between 0-12
");
                           scanf("%f",&lines);
                       }
              clrscr();
              printf("\tThe %.3f times table\n",table);
                                          for(count=0; count<=lines;
count++)
                                              {
                                                total=count*table;
                                                printf("\n%.1f * %.1f=
%.1f\n",count,table,total);
                                              }
                                                printf("Do you want another
go y or n \n");
                                                fflush(stdin);
                                                scanf("%d",&end);
                                                     table=0;
                                                     lines=0;
                                                     }while(end=='y');
 }



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019