Question:

C language problem plz help me?

by Guest45448  |  earlier

0 LIKES UnLike

Given an int variable datum that has already been declared, write a statement that reads an integer value from standard input into this variable.

 Tags:

   Report

5 ANSWERS


  1. Sounds like a java Programing  Question????

    Look into java.io.BufferedReader, java.lang.Integer.parseInt and java.util.Scanner

    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

    datum = in.readLine();

    and

    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

    datum = Integer.parseInt(in.readLine());


  2. void main(void)

    {

      int a;

    printf("input-->");

      scanf("%d",&a);

    }

  3. First off your in the wrong forum and while programming is c is not my forte let me try a stab at it anyway.

    var = Cinput;

  4. ???

  5. As you're not asking for a complete function, but only a statement that reads an integer value from standard input, here's your answer (Just one line):

    scanf ("%d", &datum);

    Note:

    As it was specified, the variable datum was previously declared ( int datum; ) and possibly initialized ( datum = 0; ).

Question Stats

Latest activity: earlier.
This question has 5 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions