Input Statement In C Or Way Of Writing C Program

Way Of Writing C Program, How Much Way We Can Write C Program
\\ If you have any query or questions on my post then please comment below //

Input Statement/ Way Of Writing C Program:
we can write c program in 2 way: 
1. Compile Time Initialization : At the time of compilation we give input.
2. Run Time Initialization : At the time of running or execution we give input.

Example Of Compile Time Initialization:
---------------------------------------------------------------------------
// Write a program to print 2 no. in c programming using compile time initialization.//
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
a=2;
b=3;
printf("%d%d",a,b);
getch();
}
----------------------------------------------------------------
In the above program we declare 2 variable as int, and we are also giving the value of a = 2 & b = 3. So here we are giving input inside program or under the code. Hence the input code will run at the time of program compilation, That's why it is called as compile time initialization.

 Example Of Run Time Initialization:
---------------------------------------------------------------------------
// Write a program to print 2 no. in c programming using run time initialization.//
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("Enter 2 no's");
scanf("%d%d",&a,&b);
printf("Entered 1st No is::%d \n",a);

printf("Entered 2nd No is::%d ",b); 

getch();
}
----------------------------------------------------------------
In this program you see we are giving the output at the time of run, not in compile time. That's why it is called as run time initialization.
These are the 2 way which we can write the c program or any program in any programming language.

Watch Our Video Tutorial On Way Of Writing Program:  
 


 

 
Click Here To Know How To Download Above Video Tutorials Or YouTube Videos Free


 Enter Your Email Id To Get Our Programming, Web Development, Video Tutorial, Job Updates In Mail :

Labels: ,