Pages

Friday, 1 March 2013

C Part 2

In C programming we usually write void main do you all know what that means and how can we actually write a program. When i asked the same question to some of my friends in computer science the replayed that the structure is like that.



But dear friends do you all know what is actually main means. It is simply a function which is used to execute the programs using simple language.

In other words it is the staring point of the program

the void used is showing that the program will not return any value we can also write int main or char main but be careful if the value returned is not an integer or a character correspondingly then their will be error in the program.

Friends when we are writing a program we must be cautious that their will be a lot more additions in your program and make only the public variables and avoid private variables except password etc..

So here is a simple program for starting

<#include<stdio.h>
#include<conio.h>
void main()   \\you can use either int,char or void at this place{1}
 {
     printf("hello friends");
          getch();\\this is used for blocking the output screen from exiting
      \\if you are using int at {1} then use return integer value;
      \\if you are using char at {1} then use return 'Character value";

}
  



OK friends now try to use the information and vary the return value....so best of luck

No comments:

Post a Comment