This is the first time I typed a program on my laptop, and it's not working as expected.
Here's what it looks like:
And here's a trial run:
What exactly am I doing wrong? Thanks for your help..
Okay, the source code is too minuscule to read, here's a copy/paste of the source code..
Here's what it looks like:
And here's a trial run:
What exactly am I doing wrong? Thanks for your help..
Okay, the source code is too minuscule to read, here's a copy/paste of the source code..
C++:
#include<stdio.h>
int main()
{
char name[20];
int item=0;
float cost=0;
printf("Enter item name, followed by return \n");
scanf( "%[^\n]", name); //[^\n] forces scanf to accept ALL input until ENTER is pressed
printf("Enter item number, followed by return (no space allowed) \n");
scanf( "%d", &item);
printf("Enter cost, followed by return (decimal values allowed) \n");
scanf( "%f", &cost);
printf("Here's what's stored in the computer's RAM \n");
printf("Item name = %s \n", name);
printf("Item number = %d \n"), item;
printf("Item cost =%f \n"), cost;
getch();
return 0;
}