Program to print a integer entered by a user in C

Source Code

// 2. Program to print a integer entered by a user
// Arpan Das - CST 2nd Year (VOCLET)

#include <stdio.h>
//#include <conio.h>
#include <stdlib.h>

void main () {
	int num;
	//clrscr();
	//system("cls");
	
	printf("Please enter any integer value: ");
	scanf("%d", &num);
	printf("\nThe entered number is %d", num);
	
	//getch();
}

Output

Please enter any integer value: 5

The entered number is 5

Leave a Reply

Note: Your email address will not be published. Required fields are marked *