Posts

Showing posts from 2019

Types Of Function

                                                             CATEGORY OF FUNCTION 1.Library function 2.Userdefined function LIBRARY FUNCTION It is also called predefined function or built-in or system define or fundamental or intrinsic function.This type of function is predefined by the system we cannot modify in this type of function.It has limited task.A user can only used the function but cannot change them.It means than user cannot understand the internal working of these function. For example: printf(),scanf(),clrscr(),getch() etc. NOTE: Whenever we use libray function in our program then the related header file must be included. USER-DEFINED FUNCTION The functions which are designed according to the requirement user are called User-defined function .The user can modify this type of function there task is not lim...

FUNCTION IN C

                                                               FUNCTION Afunction is a group of statements that together perform a task.Every C program has at least one function, which is main(), and all the most trivial programs can define additional functions. Afunction declaration tells the compilar about a function's name, return type, and parameters.A function definition provides the actual body of the function. The C standard library provides numerous built-in functions that your program can call.For example strcat() to concatenate two strings, memcpy()  to copy one memory location to another location, and many more functions. Why we need functions in C Functions are used because of following reasons – a) To improve the readability of code. b) Improves the reusability of the code, same function can b...

Input devices

Image
                  Input devices                     Keyboard Keyboard is the most common and very popular input device which helps to input data to the computer.The layout of the keyboard is like that of traditional typewriter, although there are some additional keys provided for performing additional functions.                           Mouse Mouse is the most popular pointing device.It is a very famous cursor control device having a small palm size box with a round ball at its base, which senses the movement of the mouse and sends corresponding signals to the cpu when the mouse button are pressed.                   Scanner            Scanner It is an input device, which works more like a photocopy machine.It is used when som...

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 c...

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 ...

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...

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...

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...

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 ...

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. ...

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...