
- Forum
- Programming Talk
- C and C++
- Entering strings
Entering strings
This is a discussion on Entering strings within the C and C++ forums, part of the Programming Talk category; #include <stdio.h> main() { char name [19]; int age; puts("Enter your name and ID:"); fgets(name,18,stdin); fputs("Your name is:%s",stdout); fputs("Enter your ...
-
Entering strings
#include <stdio.h>
main()
{
char name [19];
int age;
puts("Enter your name and ID:");
fgets(name,18,stdin);
fputs("Your name is:%s",stdout);
fputs("Enter your age:",stdout);
scanf("%d",&age);
puts("Your age is:%d years", age);
return 0;
}
/* this has been giving me errors all day how do I make it work using Microsoft Visual B asic 2010 THANK YOU*/
-
Please check Line 11 where you are making use of puts function
The syntax usage appears to be wrong
-
02-23-2012, 08:09 AM #3
- Join Date
- Feb 2012
- Answers
- 66
You have entered
puts("Your age is:%d years",age)
it is not puts it is fputs.
-
Sponsored Ads

Reply With Quote





