Slimelite BBS

Thanks...

Back to EMULATE

From Rob Wouda · 1996-04-08 00:39 · #73669 in EMULATE

Answering a msg of <Sunday March 31 1996>, from Greg Aluise to All:

#include <stdlib.h>
#include <conio.h>

void main(void)
{
 char buffer[83];
 char *string;
 int v1, v2;

 /* There's space for 80 characters plus the NULL terminator */
 buffer[0] = 81;
 textcolor(CYAN + BLINK);
 cprintf ( "Enter a number: " );
 string = cgets(buffer);
 v1 = atoi(string);
 cprintf ( "\n\rEnter a second number to add to first: " );
 string = cgets(buffer);
 v2 = atoi(string);
 cprintf ( "\n\rThe result is: %d", v1 + v2 );
}

cya
     Rob

--- GoldED/386 2.50 + Gecho 1.00 + FrontDoor 2.12
 * Origin: Why do Kamikaze pilots wear helmets? (FidoNet 2:283/7.38)