Monday 18 March 2013

Learning part-1

For the introduction we have to learn about the various "things" used in a program.... For a sample, we take a program with the following question:

Write a program (W.A.P) to print the no 31.

The program question has the following code:

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf("31");
getch();
}

output:

31

Now for the overall analysis:

# :- is known as 'preprocessor directives' and is used for "including" the header files for the code to be used in                                                                                                                             the program.

include :- it is used for taking in the header files used in the code.

stdio.h :- standard input output library..... a header file with many functions but most prominent the input output functions

conio.h :- console input output library..... another header file with many functions... mostly used are getch() and clrscr() {unknown for now... you will know later.. patience people}

void :- as the name suggests represents nothing... don't be confused,people ..... "nothing" in the sense- nothing to return to the main function - main() which brings us to

main() :- a standard function representing the main part of a program.

clrscr() :- a function to clear the screen for the next time output displaying.

printf() :- the function to print something.

getch() :-function accepting character and appearing to stop the screen until any value taken.


A simple program like this has so many things to be understood... think how difficult it is to make program codes for games like Dave....

Many "things" such as functions and return types, etc will be understood gradually....

**********************************************************************************************************************************

1 comment:

  1. Where is the sports toto in Florida? - Sporting 100
    › › 김해 출장마사지 Florida Sportsbooks › 여수 출장안마 › Florida Sportsbooks Sportsbooks, betting and odds 사설 토토 사이트 are a great way to bet on sports and events you can 성남 출장안마 wager on. We offer 나주 출장마사지 state-level odds on football, basketball,

    ReplyDelete