C For Beginners

   »    Learn C syntaxes

Computer Education, Training & Tutorial Resources - ComputerEducationWorld.com
Home » Free Educations » Free Programming Training » C Programming » C For Beginners »

At the character level, getchar() reads one character at a time from stdin, while putchar() writes one character at a time to stdout.

#include

main()
 {
  int i;
  int ch;

for( i = 1; i<= 5; ++i ) {
  ch = getchar();
  putchar(ch);
  }
 } (more…)


• • •
 

To indicate that the function does not return a value, declare it with a return type of void.Also to declare that there is no arguments with function just write void in place of it.

Syntax :

—-void function-name( void ){ body}——
  

A simple function is, (more…)


• • •
 

Functions are easy to use; they allow complicated programs to be parcelled up into small blocks, each of which is easier to write, read, and maintain. 

A function is declared in the following manner:

return-type function-name(parameter-list,…

{ body… }

return-type -is the variable type that the function returns. This can not be an array type . If not given, then int is assumed. (more…)


• • •
 

The return statement immediately ends the execution of a subprogram and returns control to the caller.

For a function of return type void, a return statement is not strictly necessary. If the end of such a function is reached without encountering a return statement, control is passed to the caller as if a return statement without an expression were encountered. In other words, an implicit return takes place upon completion of the final statement, and control automatically returns to the calling function.

(more…)


• • •
 



captcha PHP Script Free PHP captcha script free php
Website Design by WebWalas.com