Pages

Write a program to get a number from user and print on screen in c language

Monday, 22 April 2013

#include <stdio.h> // header file which contain printf(); funcion.

#include <conio.h> // header file which contain getch() funcion
int main() // start body of program.
{
    char num; // declaration of variable which is use to store data during the execution of program
       printf("Enter a number: ");  //prompt
       scanf("%d", &num); // scanf is used to get input from user.
       printf("your have entered %d", num); // %d is formate specifier use to tell about data that is character or number and num is variable name which store our number
       getch(); //function which is mostly use to hold screen while you typing a charachtar on screen
}

 

Search Box

Most Reading

Contact Form

Name

Email *

Message *