Latest Post
Showing posts with label Introduction To C. Show all posts
Showing posts with label Introduction To C. Show all posts

Introduction Of C Programming And The History

Written By Unknown on Saturday, October 5, 2013 | 9:15 AM

C may be a general language that has been closely related to the UNIX system OS that it absolutely was developed - since the system and most of the programs that run it area unit written in C.

Many of the vital concepts of C stem from the language BCPL, developed by Martin literary critic. The influence of BCPL on C proceeded indirectly through the language B, that was written by Ken Thompson in 1970 at Bell Labs, for the primary UNIX system on a DEC PDP-7. BCPL and B area unit \"type less\" languages whereas C provides a spread of information sorts.



Dennis Ritchie writes C In 1972 at Bell Labs  and in 1978 the publication of The C artificial language by Kernighan & Ritchie caused a revolution within the computing world.

In 1983, the yank National Standards Institute (ANSI) established a committee to supply a contemporary, comprehensive definition of C. The ensuing definition, the ANSI commonplace, or \"ANSI C\", was completed late 1988.

Understanding C Program - Basic 1

This is an introductory program and from here we are going to learn A,B,C of a C Program.....

Program 1 :

#include<stdio.h>
#include<conio.h>
main()
{
Printf(“Hello Shakhawat ”);
}

OUT PUT : Hello Shakhawat


Program Analysis:

include<stdio.h> : It is a “preprosseor directive” always start from “#” and “stdio.h” is Standert Input/Output Header File.It Contains the details of “printf” file.If we use Printf(“”) in any program then we must write # include<stdio.h>

include<conio.h> : If we use clrscr() and getch() in any program then we must use #include<conio.h>.It is also a header file.

main() : We must use our every C programming fungtion into this “main()” fungtion.”()” This is called parentheses always stand after main.We don’t use semicolon after main() because main() is not an indivisual instraction or statement.Every instructions and statements works under main() fungtion.

{} : These are called brace.Left one is left brace “{“ and the right one is Right brace “}”.



printf() : To print something to our computer screen we will have to use printf().(“”) : this is called Double Quotes.It is used to print something in between (“………..”).

;  : It is called semicolon.We must use this after every instruction.Every instruction + semicolon is called statement.


Program 2 : New Line Creation

#include<stdio.h>
#include<conio.h>
main()
{
printf(“saad\nsayem\nshuvo”);
getch();
}

OUTPUT :  saad
                   sayem
                   shuvo


Program Analysis:

\n : It is a new line creator.We can use it into double quate(“………”).If we write something after \n,it will print in a new line after first line.Please follow the OUTPUT.

getch() :  getch() is related to conio.h headerfile.It will show and get the output on computer screen.

Basic C Programming Question And Answer 1

1.Can I use same compiler for both C and C++ ?
  
    a) Yes
    b) No

Ans : Yes

2.Find out the error :

# include<stdio.h>;
   main()
  {}

Ans : Semicolon after # include<stdio.h>; is not allowed.

3. This Program is correct or not?

# include<stdio.h>
   main()
   {
   printf("calling main");
   main();
   }

Ans: It is not permitted to write main() into main function.



4.Get True or False :
  a)main() function is required to write every C Program.
  b)Program execution starts from main().
  c)"A" and "a" is two same character in C Program.
  d)\n is new line creator.
  e)We can run program with compile error.

Ans : a)True b)True c)False(These are two different character) d)True e)False

5.Find out the errors:
1.# include<stdio.h>
2.# include<conio.h>
3.   Main()
4.  {
5.   Printf(“Get Me Out Of Here);
6.   getch()
7.   }

Ans : Line 3:"M" cant be capital;
         Line 5."P" cant be capital,Double quote in printf (");
         Line 6.Semicolon After getch(). 

CONFUSE??

CONFUSE??
 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Learn Programming - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger| Distributed by Rocking Templates