Posts

Showing posts from November, 2019

Constant in C

Image
                    Constant in C Constant The constant in  C are available to the values which do not change during the execution of the program. There are several types of constant in C: a.Integer Constant 5,10,15......., these are the sequence of the number from 0(zero) to nine without decimal point or fractional part or any other symbols. b.Real Constant Real Constant are often known as floating point constant. Integer constant are unfit to represent floating value,then it is represented by real constant. c. Character Constant Character Constant has two types as follows: 1. Single Character Constant A character Constant is a single character. They are also represented with a single digit or a single special symbol or white space (blank space) enclosed within a pair of single quote(") marks. 2.String Constant String Constant of character in closed within a double quote mark("....").The string may be combination of all kinds of symbol. exa

Branching Statement

Image
        Branching Statement in C Conditional Branching The Conditional Branching Statement help to jump from one part of the program to another depending on whether a particular condition is satisfied or not.These desion control statement include: 1.Branching 2.Jumping 3.Looping 1.if statement a.Simple if statement b.if else statement c.nested if statement d.else if or ladder if 2.Switch statement If Statement The if Statement is the simplest form of decision control statement that is frequently use in decision making . It execute statement or set of statements when the logical condition is true the statement of if block are executed otherwise these statements will we skipped and the execution will jump to next statement. Syntex: if(condition) statement; If else statement In the if else statement, first the test expression is evaluated.If the expression is true, statement block 1 is executed and statement block 2 is skipped.otherw

Computer generation

Image
                Computer Generation 1st generation The period of 1st generation was 1942-1954. The main features are- *Vaccum tube technology *Unreliable *Supported Machine Language Only *Very Costly *Generate lot of heat *Need A.C *Non Portable *Consumed lot of Electricity 2nd Generation The period of second generation was 1952-1964. The main features are- *Use of transistor *Reliable as compared to first generation computer *Smaller size as compared to first generation *Consumed less electricity *Faster than first generation *Still very Costly *Support machine and assembly language *A.C needed   3rd generation The period of third generation was1964-1972. *The main features are- *Use of integrated circuit *More reliable *Smaller size *Generate less heat *Faster *Still costly *A.C needed *Consumed lesser electricity 4th generation The period of fourth generation was 1972-1990. The main features are- *Very Large Scale Inte

Program in C

          Programs Perimeter of triangle 2*(l+b) Write a program in c to find the perimeter of the triangle. #include <stdio.h > #include <conio.h > void main() { int l, b, p; clrscr() ; printf ("Input the l & b") ; scanf ("%d%d", & l, & b) ; P=2*(l+b); printf ("%d", p) ; getch () ; } Area of rectangle A=l*b Write a program in c to finde the area of rectangle. #include <stdio.h > #include <>conio.h > void main () { int l, b, a; clrscr () ; printf ("Input the l and b") ; scanf ("%d%d", & l, & b) ; area=l*b; printf ("\n%d", area) ; getch() ; } Sum of digits program in C C program to sum each digit: We can write the sum of digits program in c language by the help of loop and mathematical operation only. Write a c program to print sum of digits. #include<stdio.h>      int  main()     {     int  n,sum=0,m;     printf( "

Operator and its types.

            Operator and types Operator An operator is a symbol that indicates the compilar to perform certain maniculation (mathematical or logical) on various data item.                     Or Operator specified an operation to be perform that obtained a value. For eg: X+Y 'X'=operand '+'=operator Y=operand Operand It is a data item on which an operator acts. Categories: It can be classified into several categories: 1.Arithmetic operators 2.Relational operators 3.Logical operators 4.Assignment operators 5.Increment and decrement operators 6.Conditional operators 7.Bitwise operators 8.Specialperators 1.Arithmetic operators These operators are used for numerical or mathematical calculation there are generally five arithmetic operators i.e. Symbols. + = Addition - = Substraction * = Multiplication / = Division % = Remainder (Module division) Addition: The ‘+’ operator adds two operands. For example, x+y. Subtraction: The ‘-‘ 

Basic structure and definitions

             Structure  and definitions   Important library functions : #include <stdio.h> This is a preprocessor command that comes as the first statement in our codes. All preprocessor command start with #symbols. The #include statement tells the compilar to includ the standard input, output library or header file in the program. This file has become in built function. Preprocessor Language processing system translates the high level language to machine level language or absolute machine code. Compilar A compiler is a special program that processes statements written in a particular programming language and turns them into machine language or "code" that a computer's  processor  uses. Int main() Every c program contains a main function which the starting point of the program. Int is the return type of main function. Int means return the value.  Printf   It is a function which is used to display the message. Printf stands for print formated. 

Array in C programming

                  Array Array is the collection of same data type.Array indices start at zero in C, and go to one less than the size of the array.  For example, a five element array will have indices zero through four.  This is because the index in C is actually an offset from the beginning of the array.  ( The first element is at the beginning of the array, and hence has zero offset. ) An array is a special type of variable used to store multiple values of same data type at a time. There are 2  types  of  C arrays .   They are, One dimensional  array . Multi dimensional  array . Two dimensional  array . Three dimensional  array . four dimensional  array  etc… Some texts refer to one-dimensional arrays as vectors, two-dimensional arrays as matrices, and use the general term arrays when the number of dimensions is unspecified or unimportant. The index value in an array is also called as  subscript. Pair of one sub- script is one dimensional array. Pair of two sub-sc

First in C programming

                First C Program  To write the first c program, open the C console and write the following code: #include <stdio.h>      int  main(){     printf( "Hello C Language" );     return  0;    }   #include <stdio.h> includes the standard input output library functions. The printf() function is defined in stdio.h . int main() The main() function is the entry point of every program in c language. To compile and run the c program, by menu and by shortcut. By shortcut key Press ctrl+f9 keys compile and run the program directly. User will see the output on the screen by pressing the alt+f5keys. Now, press Esc to return the turbo c++ console.  printf and scanf is in lowercase because it is a keywords. Keywords is a set of reserved words. All keywords are basically a sequence of characters that have a fixed meaning.There are only 32 reserved words (keywords) in the C language. A list of 32 keywords in the c language is given

Getting Started With C

Image
Communicating with a computer involves speaking the language the computer understands, which immediately rules out English as the language of communication with computer. The classical method of learning English is to first learn the alphabets used in the language, then learn to combine these alphabets to form words, which in turn are combined to form sentences and sentences are combined to form paragraphs. Learning C is similar and easier. Instead of straight-away learning how to write programs, we must first know what alphabets,numbers and special symbols are used in C, then how using them constants, variables and keywords are constructed, and finally how are these combined to form an instruction. A group of instructions would be combined later on to form a program.           A to Z =26          a to z =26          0 to 9=10          underscore=1           Total.         =63 Learning English Language: Alphabet --- Words --- Sentence --- Paragraphs Learning C