Monday, 18 December 2017

Program in c or c++ to print number entered by user

1.PROGRAM IN C FOR PRINT ENTERED NUMBER BY USER.

#include<stdio.h>
#include<conio.h>
void main()
{
int num;
clrscr();

printf("Enter the number="); //printf() displays the formatted output

scanf("%d",&num); //scanf() reads the formatted inputs and stored them

printf("you entered:-%d",num); //display the output
getch();
}


2.PROGRAM IN C++ FOR PRINT ENTERED NUMBER BY USER.

#include<iostream.h>
#include<conio.h>
void main()
{
int num;
clrscr();

cout<<"enter the number"; //it is use for display the output

cin>>num; //reads the input and stored them

cout<<"you entered:-"<<num;
getch();
}



c programming ,c language,c programming language,basic c programs,simple c programs,introduction to c programming,c programming example,
c++ 

Hello world program in C and C++

1.HELLO WORLD PROGRAM IN C LANGUAGE.

#include<stdio.h>
#include<conio.h>
void main()
{
printf("Hello world"); //printf() is used for displaying string inside this function
getch();
}


2.HELLO WORLD PROGRAM IN C++ LANGUAGE.

#include<iostream.h>
#include<conio.h>
void main()
{
cout<<"Hello World";
getch();
}


Program in c or c++ to print number entered by user

1.PROGRAM IN C FOR PRINT ENTERED NUMBER BY USER. #include<stdio.h> #include<conio.h> void main() { int num; clrscr(); ...