Exforsys
+ Reply to Thread
Results 1 to 3 of 3

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 ...

  1. #1
    nhamo10 is offline Junior Member Array
    Join Date
    Feb 2011
    Answers
    1

    Smile 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*/


  2. #2
    lokeshm is offline Member Array
    Join Date
    Apr 2005
    Answers
    83
    Please check Line 11 where you are making use of puts function
    The syntax usage appears to be wrong


  3. #3
    Sandhya.Kishannag is offline Member Array
    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



Latest Article

Network Security Risk Assessment and Measurement

Read More...