Tuesday, August 6, 2019

advantage and disadvantage of flowchart in c



                                           Advantage of flow chart 

Better communication:- 

 A flow chart is a pictorial representation of a program. Therefore it is easier for a programmer to enplane the logic of the program to some other programmer or to his/her boss. 

Efficiency coding :-

 Once a flow chart is ready programmer find it very easy to write the corresponding program, because the flow chart acts as a road map for them. It guides them to go from the starting point of the programmer to the final point.

Systematic debugging:-

 A floe chart is very useful in detecting location and removing mistakes in a program in a systematic manner easier to flow the logic of the program in flow chart.

                                          Disadvantage of flow chart 

time consuming :- 

 flow charts are very time consuming to draw with proper symbol for the instruction of the program. 

 space :-

 the space required by the flow chart of a program is very high. Because it require different type of symbol for each instruction of the program.

Correcting error:-

 If any error arrive after completion do not able to correct the error in same flow chart to correct them we required to draw a new flow chart for the program after removing the program after.

basic flowchart symbols and their definition


(13) basic flowchart symbols and definition


terminal :-

 this symbol indicate the start ( beginning) and end ( stop) in a programmer logic. It is first and last symbol in a flow chart.

 Input /output :- 

 This symbol is used to present the all input/output received a programming logic.

Process :- 

 A process symbol represent arithmetic and data movement. Hesse all arithmetic process of adding, multiplication, division etc. are indicate a processing symbol. The logical process of moving data from one location to another location of memory ( assignment statement ) are also indicated by this symbol. 

Decision 

It indicates a decision point that is a point at which a branches to one of two or more alternative point is possible during expression. The appropriate path is followed depending upon the decision. Example :- a=10 B =12
 

                                                           Flow line


 Flow line with arrow head indicate the flow of operation. i.e. the exact sequence in which the instruction are executed. The normal flow of a flow chart is from top to bottom and from left to right. 


                                                         Connectors 

 This symbol represented and entry from or an exit to another part of the flow chart. A connector symbol is a circle with a letter or digit placed with in it to indicate the link. 

                                                          Annotation


 It is a comment symbol. If we require to give a connect ( any message ) for the instruction then we use annotation symbol. It is very useful to understand the instruction use in flow chart. 

what is flowchart in c

(12) What is Flow chart?

a flow chart is a pictorial representation of an algorithm it uses bones of different type of instruction. The use of symbol having a standard meaning makes it easier to communication programme logic through chart. This is because as long as every one uses the same basic symbol other can easily inter print the logic.

For example :- 

A dimond always means a decision. Hence when a programmer, looks at flow chart can easily identified the decision point because they are indicate by diamond shape box. Normally an algorithm is first represented as a flow chart is then expressed in programming language to prepare a computer programme.

 Basic flow chart 

symbol terminal ( oval ) 
input/ output ( parellelelogram.).
process (rectangle)
decision ( diamond shape)
flow line.
connectors 

Saturday, August 3, 2019

What is Number,Integer,Float,Character,String,Boolean?

(11)What is Number , Integer , Float , Character , String , Boolean?

Number 

Number is a symbol and mathematical object used for measuring weighting and counting at a time.
 It is two type integer.          Integer             Float 
                                                                                                      
Integer :-

It is collection of digit through 0to9. it is used in count
 It occupied 2 byte in memory for storage. 
                                             The range of integer is -32768 to 32767. 
Example:- -2, 5,125, 256.

     Float :- 

*It is a value which must have a decimal point. 
                   * It is used in measuring of length weight or calculation of arithmetical operation which may have a decimal point. 
                                                *It occupied 4 byte for storage in memory. 
                                                 * Its range may be 3.4 e-38 to 3.4 e 38 depends on system configuration . ( 16 bit or 32 bit processor). 
Example :- 4.5,3.2,4.00 etc are the example of float value
 0.0064 => 6.4*10-3 
Float value=> 6.4*e-3 

Character:- 

 It is a single character ( digit , alphabet, special character). 
 It must be enclosed in single quote.
 It occupied 1 byte for storage in memory. 
 Example ‘a’ , ‘2’ , etc. 

String :-

 It is a collection of character (digit alphabet & special character). 
 It must be enclosed in double quote.
 More than one character is called “string”. 
 Example :- “shailesh” “ neha”

Boolean:- 

 It is a constant which have two value. 
 It may be either true (1) and false(0). 
 It generally used in condition statement, where are make a decision according to instruction provide by user.
 Example :- X=10 Y 12 If (x>y)-> false.  

Flow chart:- 

 It is a pictorial representation of an algorithm. 
Ex :- adding two number.

 Start. 
 Print “ enter two number”.
 Input a,b. 
 Sum= a+b.
 Printf “ sum of two number”. 
 End.  

what is variable and constant in c

(10) What is Variable?



 Variable is a character or group of character assigned by the programmer to a single memory location and used a in the program as the name of that memory location in order to access the value stored in it.
 Example:-
                                  x=7
                                  X is a variable
                                  Y = x+5 = 7+5=12
                                  Z = y+5 = 12+5=17

Naming rules to defined a variable:- 

            ~first letter must be an alphabet or under s (-)l 
            ~no space or special character except under score allowed in a variable. 
            ~ A variable name in case sensitive a=5, y= a+5 here, a has other value& a has another value. 
            ~A variable name is collection of alphabet, digit or underscore. Ex :- A2=5 A2 - = A2 
                     ( the first letter must be alphabet or underscore) 
            ~ Maximum number of character is a variable may be 8or32 depends on system configuration                                                  ( processor). 
            ~1. abc 2. abc 3. ab$c 4. $abc 5. ab-c 6. 2 ab. 7. mohit kumar. 8. abcd- 
            1. true.
            2. false. 
            3.False. 
            4. false. 
            5. false.  
            6. false.  
            7.false. 
            8. true.

Constant :- It is a fixed value which is used in a programme to perform a task. It may be used to assign a value to variable 
 A constant may be of following types:- 
                                     1. numbers 
                                                    A. integer ( without decimal). 
                                                    B. float (real , with decimal). 
                                     2. character (single alphabet). 
                                     3. string ( group of character). 
                                     4. Boolean ( true or false)  

what is operator in c

(9) What is Operator?

 An expression is a combination of variable, constant and operator. The operator is used in expression to perform a task.

For example:-           3x+7 Here ,
                                 “3& 7” is a constant
                                 “x” is a variable.
                                 “+” is a operator of the above expression, which perform addition.
 There are following types of operator 
                                      1. arithmetical operator (+, - , / , *)
                                      2. relational operator ( < ,> , >=, <= , =, ! ) 
                                      3. logical operator ( true or false) 

arithmetical operator :-  the operation which perform an arithmetical operation (task) are called “ arithmetical operator” .
 there are following types of arithmetical operator. 
                                                               + -------- plus.
                                                                - -------- minus. 
                                                                * -------- multiplication.
                                                                / ------- division.  
                                                                % -------- remainder ( modulus), 

Relational operator :-                          “>”----------- greater than. 
                                                               “ <” ---------- less than. 
                                                               “==”---------- equality. 
                                                               “ >=” -------- greater than equal to.
                                                               “<” ---------- less than equal to.
                                                               “!=” --------- not equal to

When we require to compare the value present in two variable in our program then we use the relational operator.

                                  ( > , < , ==, >= , <=) It always return any one value as true or false. 

Example :-                                 x=5, y=6
  Equality(==)                             x==y 
  X=5, y=5                                  false 
  X==y                                        True 

Note:-    “ =” assignment operator using this operator in a program  we assign a value to the variable as per our requirement. 

For example:-         X=5 
                                 X=25%10 
                                 X=25+5                 


Logical operator:-   The operator which allowed a user to make a decision on two expression in a program then we use a logical operator. It always return true or false.

 And operator:-   It return true, if the expression present in both side( left& right) at the operator return true, other wise return false. 
F and a = false.
 F and t = false.
 T and f = false. 
T and t = true. 

Expression Example:-   4>5 AND 5>3-- expression 2 
                                        And is logical operator F and T False. 
                                         6>3 and 5>2 T and t True 

 3>5 and 4>8 
  F and f 
    False.  
C           A             B            R=a>b             S=a>c             R and s 
10          5             6               F                      F                        F 
 5           4             8               F                      F                        F 
 8          12            6               T                      T                        T 

OR 
          It return true if the any one expression present in “ or” operator return true it return false if the both al expression return false.

 Example   
                    5>3 or 2>5                                                             6>8 or 8>9 
                      T or f                                                                       f or f 
                        True                                                                        false. 
 C         A             B         R=a>B           S=a>c           r. or s 
10        25            6            T                    T                    T 
 5          2             4            F                     F                    F 
 3          5             6            F                     T                    t 

NOT :- It is a logical operator which is used to negate ( true false& false to true) the values ( logical value) present in a variable. 

Example :-      
                            A= true                        if y= false 
                            Not a = false                the not y true 

Truth table :- 
D      A          B       C=a>b        R=b>d       C and r       C or r       Not c     Not r 
10      5         15          F                 T                 F                T             F          12
12      8          4           T                 F                 f                  t             F            t

Priority of operator :- 
                                   Solve this 
                                               (3+5)>(5+4) and (2-1)>5 
                                                  8>9 and 1>5 
                                                        f and f 
            now we can say from above example the first priority is the arithmetic operation second and third priority is the relational and logical operation respectively………….. 
                                            (5+3) > (4+5) AND (2-1)>5 
                                                       8>9 AND 1>5
                                                           F and f 
  F 

what is algorithm explain with example

(8) What is Algorithm ?

] It refers to the logic of a program., it is a step description of how to arrive at a solution to a given problem. It defined as a sequence of instruction that when executed in the desired result are obtained . it is called “ algorithm”. The world algorithm comes from the name of a persion author “ abu jafer mohammed ibn musa al khwarizmi” this word has been specified significance in computer science where “ algorithm” has come to refer a method can be used by a computer of a problem.

Feature of algorithm:-  

                                                 Input.
                                                Output.
                                                Finitness.
                                                Definiteness.
                                                Effectiveness.

 How to write an algorithm:- 

Q :- adding any two no. 

            ~ Start . 
            ~ Print” enter any two no” 
            ~ Input a,b 
            ~ S= a+b 
            ~Print” the sum of two no is”,s. 
            ~End 

Start :- It shown the starting point of algorithm.

Print :- Using this we can display (print) any user defined message as per requirement. The message must be enclosed in double quote. We can also print (display) the value present in a variable. As print “the sum of two variable is” , s. 
 Or……. Print “the sum of two no”, print s. 

Input :- It is a keyword which is used to define the all variable which store the value required for our algorithm to perform task. Example :- Input a , b A&b are two variable which any two value.

End :- It is a keyword, which store the ending your algorithm.

Wednesday, July 31, 2019

Interpreter, Easy debugging, Portability, Readability

(7)Readability interpreter,  Easy debugging, Portability, 

Readability :-  

The coding or program written in these language are more readable than machine level language. 

Portability :- 

The coding (program) written in these language are portable i.e. we can carry the code any where in the world and run on any machine to get the result as per program.

 Easy debugging:-                                

 We can detect any error present in the coding the complex compile our program and give me all error present in the program. 

Disadvantage :-      

Slow speed :- it work very slowly it is slow to work when running a program. 

Interpreter :-  

 Interpreter is another type of translator, used to translate a high level program into its machine language, it takes  one statement of the high level language program translate it into machine language and then executes the resulting machine language immediately in this case the translation and execution process alternate for each statement encounter in the high level language. 


Advantage :-

 syntax error in a program statement is deleted and brought to the attention of the program as soon as the program statement is interpreter. 

Disadvantage :- 

It is slower than compiler when running a program.                

Saturday, July 27, 2019

What is High level language

            (6)  what is high level language in computer



 These language have been designed to give a better programming efficiency. i.e. faster programming Example:- The language such as “ COBOL” , “FORTRAN”, “BASIC”, are known as high level language.
 Add two number in basic                    Let x=10
                                                             Let y=12
                                                             Z=x+y
                                                             Print z

Advantage of high level language:-
                                                           Readability. 
                                                           Portability. 
                                                           Easy debugging.

What is Assembler


(5) what is assembler in computer.?

 When we use letters , digit special character for the operator part, address part and other part of the instruction is called “ assembly language” programmer. This consider to be the second generation language.
Example:-                   Add two number in machine language:-
                                  0001 1110 load a 7
                                  0000 1100 load b 10
                                  0000 1101 add a a+b
                                  0001 1000 store a
                                  0000 0000

 Machine language assembly language 

Advantage:- 

 Writing a program in assembly language is more convenient than in machine language because it uses symbolic instruction in place of binary instruction. 

Disadvantage:- The program is written in assembly language is specific to a particular machine architecture and assembly language are designed for specific model of micro processor. It means that a programme written for a processor will not work on another processor (default). 

what is assembler language

(4)what is assembler in computer 


 The program written in assembly language does not be executed directly by our computer system because it is not in the binary form. So we required a translator that translate the code written in assembly language , that translator is known as assembler. 
Example:- Source code ------------- assembler--------------- machine code In assembly language  

What is Transalator

(3) what is translator in programming language   ?

                                                  (a) HINDI
                                                  (b) URDU
                                                  (c)Translator

 It is a system software which translate on instruction written in a language (object language).
It convert One code  language  into other in the computer system.It translate High level language into User readable Language Such as  C++ , JAVA   Source -------- translator--------- object language(machine language) .
This translator term is used for software implementation to  Hardware implementation to the same program.
 We Widely use different type of translator:-
                           (1). Assembler.
                           (2). Compiler. 
                           (3). Interpreter.
                           (4).Linker
                           (5).Decompilers
                           (6) Disassemblers

what is machine language its advantages and disadvantages

(2) Machine language:-     



 The instruction written in machine language is directly executed by our computer. there is no any requirement of translator it is also called a low level language.It is a language which we write all instruction using 0 and 1, it is called binary digit.
Advantage :-    (1) It makes Fast and efficient use of the computer.
                         (2) It don't require any translator to translate any code.

Disadvantage :-   (1) problem in writing the instruction.
                            (2) It require 0&1 to write an instruction.
                            (3) It takes large space& time.
                            (4) It takes more time to understand the instruction written in machine language by                                  a user(another)

Whats is program and Programming ?

(1) what is program and programming

Program 

 It is a set instruction which is excited by a user to achieve a goal (task). It is a future of action which is perform by a user.

                             Programming 

It is an art of writing a program using a language that is understand by our computer. Language is a source of communication using this the two person (or more than two) communicate with each other . For example:- English , Hindi , Urdu………………etc.In computer we use c, visual basic, c++, java, pl/sql etc. to use write a program. Note:- our computer only understand the instruction which is written in “ machine language”.

Wednesday, July 24, 2019

(98) Command , Internal command , External command

Command


& an instruction processed by dos command interpreter.
Internal command, CD, MD, COPY.
&  External command
 Internal command:- in dos are such program which get loaded in the memory pc automatically along with dos at a time of booting.
                                Ex:- CD, MD, COPY, etc.
External command:- external command file that do resize on disk. Ex –format.com.
Path :-absolute
            Relative.
Absolute path:-a path that start form the driven root directory are called absolute path.
 Relative path:- a path that start from driven current directory is called path.
& File management command:-
&  MD  (make directory) :- it is used to make directory m d diramed and press enter key.
CD ( change directory):- it is used to go to current directory CD DIR NAME EX :- CD wxyz. Press enter key.
It is use that to CD-------------or CD1----- it is used to remove a directory.
c/s- clear the screen.
 Copy con:- it is use to make file copy con/ file name.
 Ctrl+z:- is used to save the file.
 Type command file name:- it is use to see the file content.
& Edit command:- it is menu driven text editor . it use to make correction in the file name and press enter key.
 Del command :- it is used to remove a  file. File name and press enter key.
 Copy command :-it is use to see the data and also change the data. C:\> data and press enter key. Entered new data {mm:dd:yy}.
& Time command :- it is used to see the time c:\> and press enterkey. Enter the new time {hh:mm:ss}.
&  Dir command :- display a list of directory file c:\> dir , and press enter key.
& Dir/p:- display in page by format c:\> dir/w press enter key.
 Dir/b :- briet display c:\> dir/b press enter key.
 Dir/ah:=headen file display c:\> dirah press enter key.
 dir/ar := read only file display c:\>dirar press enter key.
& Tree command:- it is use to see the directory in hierarchal structure. C:\>tree.
& Driven command: - it is use to change the driven. d:/> press enter key
 Format command:-it is use to mark the screen format driven name and press enter key prepare a blank disk for receive and storing.
 Fc /? It is used to display about command.
& Move command:- to move a file v:\> move source file name. d:\ deep press enter key.
 Exit command: - it is use to leave from the dos c :\> exit and press enter key.

(97) Command

 Command

 there are three of directory structure.
1.   Single level directory.
2.   two level directory
3.   Hierarchal structure.
 Master directory

             

Ø Master directory:-


             

Ø Hierarchal directory structure works line a tree structure which has root branches and root branch and sub branches with leaves.
Ø In case of hierarchal structure sub-directory of master directories.
Ø After two level directory structure with any directory level create than it is set to be hierarchal structure.
             

(96) Ms dos

 Ms dos

Ø It is kind line user interface.
Ø Ms-dos (1.0) was realised in 1981 from I B M computer.
Ø The latest version of ms-dos is 6.22 came in 1994.
Ø The history of this operating system is in july 1980 I B M assigned to developed 16bit operating system for pc 1 lakh 86 thousand dollar by micro soft.
It still can be access from every version of ms-windows

(95) Type of file

Type of file


Ø File name extension that is (.)used after a file name to show the type of file.
Ø these are described as below.
Ø Test file(.txt):-
Ø A text file a file which is created show that it can be used by only word processing program or s/w ex- shailesh.txt.
Ø Backup file-
Ø Extension name of back file are (.bak).
Ø This indicates that file contains of contains of the name file and created as a spreadsheet copy for safety purpose in case the original file is deleted or get cropped we can open the back up file.
Ø Help file :- in every software package for example ms-office word star these is a help file which contain information to help the user for hearting specific command.
ex :- doc. help.
Ø Document file:-
Ø Every word processor created a file which contains some specific symbol along with type text spaces , right spaces , etc.
Ø Graphical file:-
Ø When we draw graphical or picture using special graphics s/w such as ms paint card draw etc we use graphics file example D E E. DOC.
Ø There several other types of file for the user for different task such as ms-power , paint,(.ppt) for presentation of document – ms excel (.xls) use as a electronic spared sheet.
                                  C programming file (.c p p).
                                  C file (. C ).
                                 For profile (.abm).
                                 Ms access (.m d).