C programming basics
C programming
It is really very easy to learn so move forward.....
C programming is a basic programming language, which is procedure oriented language that means this c language is all works on functions only like main function and other predefined or user-defined functions.
C programming mainly consists of pre processor and functions, some data types as well as variables.
Example---- :
Program is as follows,,,,
#include<stdio.h>
void main()
{
int a=2;
printf("%d",a);
}
Output :2
In that pre processor we use *include* this is command , which works the including to program. And also mainthing is header files , the header files consists of pre defined functions like printf ,scanf,pow,strrev..... Examples of header files are stdio.h, math.h,stdlib.h..........
Examples-------:
1. #include<stdio.h>
2.#include<stdlib.h>
3.#include<math.h>
In that function,we can write main function in that we use parameters or else we can leave that empty that is no parameters function. And also we can use return type integers or float or void. Void means we can't return anything. Default return type of any function is integer only. If we declare as integer then we can return 0 or any value.
Examples-----
1. int main(a,b)
Here a,b are parameters
Int is return type of function
main is name of function
2.int main()
In this no parameters given, then is nothing problem in that.
Thank you for reading ..
..
I hope you understand , I follow up remaining topics next post....
It is really very easy to learn so move forward.....
C programming is a basic programming language, which is procedure oriented language that means this c language is all works on functions only like main function and other predefined or user-defined functions.
C programming mainly consists of pre processor and functions, some data types as well as variables.
Example---- :
Program is as follows,,,,
#include<stdio.h>
void main()
{
int a=2;
printf("%d",a);
}
Output :2
In that pre processor we use *include* this is command , which works the including to program. And also mainthing is header files , the header files consists of pre defined functions like printf ,scanf,pow,strrev..... Examples of header files are stdio.h, math.h,stdlib.h..........
Examples-------:
1. #include<stdio.h>
2.#include<stdlib.h>
3.#include<math.h>
In that function,we can write main function in that we use parameters or else we can leave that empty that is no parameters function. And also we can use return type integers or float or void. Void means we can't return anything. Default return type of any function is integer only. If we declare as integer then we can return 0 or any value.
Examples-----
1. int main(a,b)
Here a,b are parameters
Int is return type of function
main is name of function
2.int main()
In this no parameters given, then is nothing problem in that.
Thank you for reading ..
..
I hope you understand , I follow up remaining topics next post....

Comments
Post a Comment