Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How do you put a Standard Input into your program correctly?

+4 votes
asked Oct 29, 2024 by Benjamin V (160 points)
I was trying to use Perl programing a txt use a sample as an example when it had <STDIN>; after the equal symbol from the element, it had an error issue.

2 Answers

+1 vote
answered Oct 31, 2024 by Peter Minarik (101,420 points)

The example here works just fine.

Did you set the OnlineGDB's language to Perl (top right corner)?

If your issue persists, please, share your project (orange SHARE button two to the right of the RUN button).

+1 vote
answered Nov 1, 2024 by Shivansh Raj (280 points)
#include <stdio.h>

int main() {
    int number;

    printf("Enter a positive integer: ");
    scanf("%d", &number);  // Read an integer from standard input

    printf("You entered: %d\n", number);  // Output the entered number

    return 0;
}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...