Apr 13, 2021

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:

#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


Share This:    Facebook Twitter

0 comments:

Post a Comment

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