C program to accept input from user and print it on the output screen

 EX: Write a c program to accept input from user and print it on the output screen. How to write a c program to accept input from user and print it on the output screen. C program to accept input from user and print it on the output screen.


  Program to accept input from user and print it on the output screen:


#include<stdio.h>

void main()

{

int num;

printf("Enter your age: "); // display message using output function

scanf("%d",&num); //accept input using input function

        //print output on the ouput screen

printf("Your age is:%d",num); 

}


Above program will shows the following output:

Enter your age: 20

Your age is: 20


No comments:

Post a Comment

If you have any doubts, please discuss here...👇