PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

2015 -2016

PROGRAMMING IN C AND DATA STRUCTURES Pseudo code Pseudo code can be broken down into five components. • Variables: • Assignment: • Input/output: • Selection: • Repetition: Variable: Nothing but name given to memory location where we can store the values during execution the value may changes. Ex:

int a; int a=1;

Declaration of variable. Initialization of variable.

Types of Varibles. Local and Global variables: Local variables: Variable whose existence is known only to the main program or functions are called local variables. Local variables are declared with in the main program or a function. Global variables: Variables whose existence is known to the both main() as well as other functions are called global variables. Global variables are declared outside the main() and other functions. The following Program illustrates the concept of both local as well as global variables. About variable. A variable has a name, a data type, and a value. There is a location in memory associated with each variable. A variable can be called anything or be given any name. It is considered good practice to use variable names that are relevant to the task at hand. Assignment is the physical act of placing a value into a variable. Assignment can be shown using set = 5; set = num + set;

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

2015 -2016

The left side is the variable a value is being stored in and the right side is where the variable is being accessed. When a variable is assigned a value, the old value is written over with the new value so the old value is gone. x = 5 does not mean that x is equal to 5; it means set the variable x to have the value 5. Give x the value 5, make x equal to 5. Input / Output both deal with an outside source (can be a user or another program) receiving or giving information. An example would be assuming a fast food restaurant is a program. A driver (user) would submit their order for a burger and fries (input), they would then drive to the side window and pick up their ordered meal (output.) • Output – Write / display / print • Input – Read / get / input Selection construct allows for a choice between performing an action and skipping it. It is our conditional statements. Selection statements are written as such: if ( conditional statement) statement list else statement list Repetition is a construct that allows instructions to be executed multiple times (IE repeated). In a repetition problem – Count is initialized – Tested – incremented Repetition problems are shown as: while ( condition statement) statement list

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

2015 -2016

1: Write pseudo code that reads two numbers and multiplies them together and print out their product

Pseudo code ` Declare n1 , n2,mul Read n1,n2 Mul=n1*n2 Write mul

C

code

int n1, n2, mult; scanf(“%d%d”,&n1,&n2); mul = n1 * n2; printf(“%d”,mul);

2. Write pseudo code that reads Input the dimensions of a rectangle and print its area.

Pseudo code. read length, breadth area = length * breadth display area 3. Write pseudo code that reads Input the dimensions of a rectangle and print area and perimeter.

Pseudo code. read length, breadth area = length * breadth perimeter = 2*(length+breadth) display area, perimeter 4. Input the length of the side of a square, and print its area. Produce an error message if the length is negative. (i.e.validation) read side if side is negative print error message else print side*side endif 5. Input 3 numbers and print either an "all 3 equal" or a "not all equal" message. input a,b,c if (a=b) and (a=c) display "all 3 equal" else display "not all equal"

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

2015 -2016

endif  C is a general-purpose high level language that was originally developed by Dennis Ritchie for the Unix operating system. It was first implemented on the Digital Equipment Corporation PDP-11 computer in 1972.  The UNIX operating system and virtually all UNIX applications are written in the C language. C has now become a widely used professional language for various reasons.  Easy to learn  Structured language  It produces efficient programs.  It can handle low-level activities.  It can be compiled on a variety of computers. Facts about C 1. 2. 3. 4. 5. 6.

C was invented to write an operating system called UNIX. C is a successor of B language which was introduced around 1970 The language was formalized in 1988 by the AmericanNationalStandardInstitute (ANSI). By 1973 UNIX OS almost totally written in C. Today C is the most widely used System Programming Language. Most of the state of the art software have been implemented using C.

C Program File All the C programs are written into text files with extension ".c" for example hello.c. You can use "vi" editor to write your C program into a file. This tutorial assumes that you know how to edit a text file and how to write programming instructions inside a program file. C Compilers When you write any program in C language then to run that program you need to compile that program using a C Compiler which converts your program into a language understandable by a computer. This is called machine language (ie. binary format). So before proceeding, make sure you have C Compiler available at your computer. It comes along with all flavors of Unix and Linux. If you are working over Unix or Linux then you can type gcc -v or cc -v and check the result. You can ask your system administrator or you can take help from anyone to identify an available C Compiler at your computer. If you don't have C compiler installed at your computer then you can use below given link to download a GNU C Compiler and use it.

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

2015 -2016

Basic Concepts of C Language.  CHARACTER SET: Every programming language has its own set of characters. The characters used in C are divided into 3 categories The characters that can be used to form words, numbers and expressions depend upon the computer on which the program is run. The characters in C are grouped into the following categories. 1. Letters 2. Digits 3. Special Characters Letters : C language comprises the following set of letters to form a standard program. They are : A to Z in Capital letters. a to z in Small letters. Digits : C language comprises the following sequence of numbers to associate the letters.0 to 9 digits. Special Characters: C language contains the following special character in association with the letters and digits.

Symbol

Meaning

Symbol

Meaning

~ ! # $ % ^ & * (

Tilde Exclamation mark Number sign Dollar sign Percent sign Caret Ampersand Asterisk Lest parenthesis

|

Vertical bar Backslash Apostrophe Minus sign Equal to sign Left brace Right brace Left bracket Right bracket

\ ` = { } [ ]

2015 -2016

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

) _ +

Right parenthesis Underscore Plus sign

: " ;

Colon Quotation mark Semicolon

< > ?

Opening angle bracket Closing angle bracket Question mark

, .

Comma Period Slash

/

C tokens: 

C tokens are the basic buildings blocks in C language which are constructed together to write a C program.  Each and every smallest individual units in a C program are known as C tokens. 

C tokens are of six types. They are, 1. 2. 3. 4. 5. 6.

Keywords Identifiers Constants Strings Special symbols Operators

Keywords  Keywords are standard identifiers that have standard predefined meaning in C.  Keywords are all lowercase, since uppercase and lowercase characters are not equivalent it's possible to utilize an uppercase keyword as an identifier but it's not a good programming practice. Points to remember 1. Keywords can be used only for their intended purpose. 2. Keywords can't be used as programmer defined identifier. 3. The keywords can't be used as names for variables. The standard keywords are given below: auto

const

double

float

int

short

struct

unsigned

break

continue

else

for

Long

signed

switch

void

case

default

enum

goto

register

sizeof

typedef

volatile

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

char

do

extern

if

return

static

union

2015 -2016 while

Identifiers Identifiers are the names that are given to various program elements such as variables, symbolic constants and functions. Variable or function identifier that is called a symbolic constant name. Identifier can be freely named, the following restrictions. Here are the rules you need to know: 1. Identifier name must be a sequence of letter and digits, and must begin with a letter. ie Alphanumeric characters ( a - z , A-Z , 0-9 ) and underscore ( _ ) can only be used. 2. C is a case sensitive programming language.ie Both upper-case letter and lower-case letter characters are allowed ie varchas and VARCHAS is recognized as a separate identifier. 3. The underscore character (‘_’) is considered as letter. 4. Names shouldn't be a keyword (such as int , float, if ,break, for etc) & No identifier may be keyword. 5. C does not allow punctuation characters such as @, $, and % within identifiers and also no special characters, such as semicolon,period,blank space, slash or comma are permitted. C – Constant 

C Constants are also like normal variables. But, only difference is, their values cannot be modified by the program once they are defined.  Constants refer to fixed values. They are also called as literals.  Constants may be belonging to any of the data type. 1. Integer Constants in C:      

An integer constant must have at least one digit. It must not have a decimal point. It can either be positive or negative. No commas or blanks are allowed within an integer constant. If no sign precedes an integer constant, it is assumed to be positive. The allowable range for integer constants is -32768 to 32767.

2. Real constants in C: 

A real constant must have at least one digit

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

   

2015 -2016

It must have a decimal point It could be either positive or negative If no sign precedes an integer constant, it is assumed to be positive. No commas or blanks are allowed within a real constant.

3. Character and string constants in C: 

A character constant is a single alphabet, a single digit or a single special symbol enclosed within single quotes.  The maximum length of a character constant is 1 character.  String constants are enclosed within double quotes. Escape sequence 



NO

C supports some special backslash character constants that are used in output functions. For example, the symbol ‘\n’ stands for new line character. The below table gives you a list of backslash constants. Escape sequence are special character denoted by a backslash (\) and a character after it.It is called escape sequence because it causes an ‘escape’ from the normal way for characters are interpreted. For example if we use ‘\ n’, then the character is not treated as n but it is treated as a new line. Some of the common escape sequence characters are: Escape sequence \a \n \t \v \r \f \’ \\ \b \” \? \nnn \unnnn \Unnnnnnnn \xnn

Meaning Bell \ beep New line tab horizontal Vertical tab Carriage return Form feed single quote backslash move the character to left one space double quote Question mark Octal character value Universal character name Universal character name Hexadecimal character value

We can define constants in a C program in the following ways. 1. By “const” keyword 2. By “#define” preprocessor directive.

2015 -2016

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

C Operators C language is rich in built-in operators and provides the following types of operators: 1. 2. 3. 4. 5. 6.

Arithmetic Operators Relational Operators Logical Operators Bitwise Operators Assignment Operators Misc Operators

1. Arithmetic Operators - Following table shows all the arithmetic operators supported by C language. Assume variable X holds 6 and variable Y holds 2, then: Operator + * / % ++ --

Description Adds two operands Subtracts second operand from the first Multiplies both operands Divides numerator by de-numerator Modulus Operator and remainder of after an integer division Increments operator increases integer value by one Decrements operator decreases integer value by one

void main() { int a = 6, b = 2; variable initializing int c ; variable declaration c = a + b; printf(" Value of c is %d\n", c ); c = a - b; printf("Value of c is %d\n", c ); c = a * b; printf("Value of c is %d\n", c ); c = a / b; printf(" Value of c is %d\n", c ); c = a % b; printf("Value of c is %d\n", c ); c = a++;

Example X+ Y will give 8 X - Y will give 4 X* Y will give 12 X / Y will give 3 X % Y will give 0 X++ will give 7 X-- will 5

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

2015 -2016

printf(" Value of c is %d\n", c ); c = a--; printf("Value of c is %d\n", c ); }

2. Relational Operators Following table shows all the arithmetic operators supported by C language. Assume variable X holds 6 and variable Y holds 2, then: == != > < >= <=

Description Checks if the values of two operands are equal or not, if yes then condition becomes true. Checks if the values of two operands are equal or not, if values are not equal then condition becomes true. Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true. Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true. Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true. Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true.

#include Void main() { int a = 6, b = 2; int c ; if( a == b ) { printf(" a is equal to b\n" ); } else { printf(" a is not equal to b\n" ); } if ( a < b ) { printf(" a is less than b\n" ); } else {

Example (X== Y) is not true. (X != Y) is true. (X > Y) is true. (X < Y) is not true. (X >= Y) is true. (X <= Y) is not true.

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

2015 -2016

printf("a is not less than b\n" ); } if ( a > b ) { printf(" a is greater than b\n" ); } else { printf(" a is not greater than b\n" ); } if ( b <= a ) { printf("bis either less than or equal to a\n" ); } if ( a >= b ) { printf("a is either greater than or equal to b\n" ); } }

3.Logical Operators Assume variable A holds 1 and variable B holds 0, then: Operator

Description

Example

&&

Called Logical AND operator. If both the operands are non-zero, then condition becomes true.

(A && B) is false.

||

Called Logical OR Operator. If any of the two operands is nonzero, then condition becomes true.

(A || B) is true.

!

Called Logical NOT Operator. Use to reverses the logical state of !(A && B) its operand. If a condition is true then Logical NOT operator will is true. make false.

#include Void main() { int a = 2, b = 3; int c ; if ( a && b ) { printf(" Condition is true\n" );

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

} if ( a || b ) { printf(" Condition is true\n" ); } if ( a && b ) /* lets change the value of a and b */a = 0;b = 1; { printf("Condition is true\n" ); } else { printf("Condition is not true\n" ); } if ( !(a && b) ) { printf("Condition is true\n" ); } } 4. Bitwise Operators Bitwise operator works on bits and performs bit-by-bit operation. The truth tables for &, |, and ^ are as follows: p

q

p&q

p|q

p^q

0

0

0

0

0

0

1

0

1

1

1

1

1

1

0

1

0

0

1

1

Assume if A = 60; and B = 13; now in binary format they will be as follows: A = 0011 1100 B = 0000 1101 ----------------A&B = 0000 1100 A|B = 0011 1101 A^B = 0011 0001 ~A = 1100 0011

2015 -2016

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

2015 -2016

The Bitwise operators supported by C language are listed in the following table. Assume variable A holds 60 and variable B holds 13, then: Operator Description

Example

&

Binary AND Operator copies a bit to the result if it exists (A & B) will give 12, in both operands. which is 0000 1100

|

Binary OR Operator copies a bit if it exists in either operand.

(A | B) will give 61, which is 0011 1101

^

Binary XOR Operator copies the bit if it is set in one operand but not both.

(A ^ B) will give 49, which is 0011 0001

~

Binary Ones Complement Operator is unary and has the effect of 'flipping' bits.

(~A ) will give -61, which is 1100 0011 in 2's complement form.

<<

Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand.

A << 2 will give 240 which is 1111 0000

>>

Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand.

A >> 2 will give 15 which is 0000 1111

#include Void main() { unsigned int a = 60; unsigned int b = 13; int c = 0; c = a & b; printf(" Value of c is %d\n", c ); c = a | b; printf(" Value of c is %d\n", c ); c = a ^ b; printf("Value of c is %d\n", c ); c = ~a; printf("Value of c is %d\n", c );

/* 60 = 0011 1100 */ /* 13 = 0000 1101 */ /* 12 = 0000 1100 */ /* 61 = 0011 1101 */ /* 49 = 0011 0001 */ /*-61 = 1100 0011 */

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

c = a << 2; printf(" Value of c is %d\n", c ); c = a >> 2; printf(" Value of c is %d\n", c );

2015 -2016

/* 240 = 1111 0000 */ /* 15 = 0000 1111 */

} 5. Assignment Operators They are used to assign the result of an expression to a variable. Syntax identifier = Expression There are five assignment operators. They are, 1. 2. 3. 4. 5.

a=a+1 a=a- 1 a=a*2 a=a/2 a=a%2

a+=1 a-= 1 a*=2 a/= 2 a%=2

Operator Description

Example

=

Simple assignment operator, Assigns values from right side operands to left side operand

C = A + B will assign value of A + B into C

+=

Add AND assignment operator, It adds right operand to the left operand and assign the result to left operand

C += A is equivalent to C = C + A

-=

Subtract AND assignment operator, It subtracts right operand from the left operand and assign the result to left operand

C -= A is equivalent to C = C - A

*=

Multiply AND assignment operator, It multiplies right operand with the left operand and assign the result to left operand

C *= A is equivalent to C = C * A

/=

Divide AND assignment operator, It divides left operand with the right operand and assign the result to left operand

C /= A is equivalent to C = C / A

%=

Modulus AND assignment operator, It takes modulus using two operands and assign the result to left operand

C %= A is equivalent to C = C % A

<<=

Left shift AND assignment operator

C <<= 2 is same as C = C << 2

>>=

Right shift AND assignment operator

C >>= 2 is same as C = C >> 2

&=

Bitwise AND assignment operator

C &= 2 is same as C = C & 2

^=

bitwise exclusive OR and assignment operator

C ^= 2 is same as C = C ^ 2

|=

bitwise inclusive OR and assignment operator

C |= 2 is same as C = C | 2

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

#include Void main() { int a = 21; int c ; c = a; printf("= Operator Example, Value of c = %d\n", c ); c += a; printf(" += Operator Example, Value of c = %d\n", c ); c -= a; printf(" -= Operator Example, Value of c = %d\n", c ); c *= a; printf(" *= Operator Example, Value of c = %d\n", c ); c /= a; printf(" /= Operator Example, Value of c = %d\n", c ); c = 200; c %= a; printf("%= Operator Example, Value of c = %d\n", c ); c <<= 2; printf(" <<= Operator Example, Value of c = %d\n", c ); c >>= 2; printf(">>= Operator Example, Value of c = %d\n", c ); c &= 2; printf(" &= Operator Example, Value of c = %d\n", c ); c ^= 2; printf(" ^= Operator Example, Value of c = %d\n", c ); c |= 2; printf(" |= Operator Example, Value of c = %d\n", c ); }

6.Misc Operators Operator Description

Example

sizeof()

sizeof(a), where a is integer, will return 2.

Returns the size of an variable.

2015 -2016

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

&

Returns the address of an variable.

&a; will give actual address of the variable.

*

Pointer to a variable.

*a; will pointer to a variable.

?:

Conditional Expression

If Condition is true ? Then value X : Otherwise value Y

2015 -2016

The sizeof operator returns the size of its operand in bytes. The sizeof operator always precedes its operand. The operand may be an expression. Example: Printf(“Size of integer : %d”,sizeof(i)); Size of integer : 2 /* example of sizeof operator */ #include void main() { int a; float b; double c; char d; clrscr(); printf("Size of int: %d bytes\n",sizeof(a)); printf("Size of float: %d bytes\n",sizeof(b)); printf("Size of double: %d bytes\n",sizeof(c)); printf("Size of char: %d byte\n",sizeof(d)); getch(); } /* example of & and * operators */ void main() { int a=2; int * ptr; ptr = &a; /* 'ptr' now contains the address of 'a'*/ printf("value of a is %d\n", a); printf("*ptr is %d.\n", *ptr); getch(); } /* example of ternary operator */ void main() { int a = 10; b = (a == 1) ? 20: 30;

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

2015 -2016

printf( "Value of b is %d\n", b ); b = (a == 10) ? 20: 30; printf( "Value of b is %d\n", b ); getch(); } Formatted Input / Output: The important aspect of C programming language is its ability to handle I /O. Printf function The printf function is used to display the value to the output devices It moves data from the computer’s memory to the standard output devices. Syntax: printf(“format specifier” , arg1, arg2, ….arg n );  Formatspecifier  arg 1, arg 2

control string variables or values

Format Specifier: %d int %f float %c char %s string Scanf function: The scanf function gets data from the standard input device and stores it in the computer memory. Syntax: scanf(“ format specifier”, & arg1, & arg2,…….,& argn ) ;  Format specifierı is the control string to denote the data type of variable  & arg1, & arg2,…….,& argn are the variables which stores values.

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

2015 -2016

Format specifier: Format specifiers are the character string with % sign followed with a character. It specifies the type of data that is being processed. It is also called conversion specifier. When data is being output or input it must be specify with identifier( variable) and their format specifier. No 1 2 3 4 5 6 7 8 9 10 11 12

c d f e g h lf o x I S U

a single character a decimal integer a floating point number a floating point number a floating point number a sort integer long range of floating point number (for double data types) an octal integer a hexadecimal integer a decimal, octal or hex decimal integer a string an unsigned decimal integer

Example. #include void main() { int c; printf("Enter a number\n"); scanf("%d",&c); printf("Number=%d",c); }

UnFormatted Input / Output:

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

2015 -2016

Syntax for getch () in C : Variable_name = getch(); getch() accepts only single character from keyboard. The character entered through getch() is not displayed in the screen (monitor). Syntax for getche() in C : variable_name = getche(); Like getch(), getche() also accepts only single character, but unlike getch(), getche() displays the entered character in the screen.

Syntax for getchar() in C : variable_name = getchar();

getchar() accepts one character type data from the keyboard.

Syntax for gets() in C : gets(variable_name); gets() accepts any line of string including spaces from the standard Input device (keyboard). gets() stops reading character from keyboard only when the enter key is pressed. The unformatted output statements in C are putch, putchar and puts.

Syntax for putch in C : putch(variable_name); putch displays any alphanumeric characters to the standard output device. It displays only one character at a time.

Syntax for putchar in C : putchar(variable_name); putchar displays one character at a time to the Monitor.

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

2015 -2016

Syntax for puts in C : puts(variable_name); puts displays a single / paragraph of text to the standard output device.

A C program basically has the following form:     

Preprocessor Commands Functions Variables Statements & Expressions Comments

Preprocessor Commands: These commands tells the compiler to do preprocessing before doing actual compilation. Like #include is a preprocessor command which tells a C compiler to include stdio.h file before going to actual compilation. You will learn more about C Preprocessors in C Preprocessors session. Functions: are main building blocks of any C Program. Every C Program will have one or more functions and there is one mandatory function which is called main() function. This function is prefixed with keyword int which means this function returns an integer value when it exits. This integer value is retured using return statement. The C Programming language provides a set of built-in functions. In the above example printf()is a C built-in function which is used to print anything on the screen. Check Builtin function section for more detail. You will learn how to write your own functions and use them in Using Function session. Variables: are used to hold numbers, strings and complex data for manipulation. You will learn in detail about variables in C Variable Types. Statements & Expressions : Expressions combine variables and constants to create new values. Statements are expressions, assignments, function calls, or control flow statements which make up C programs. Comments: are used to give additional useful information inside a C Program. All the comments will be put inside /*...*/ as given in the example above. A comment can span through multiple lines.

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

2015 -2016

Note the followings     

C is a case sensitive programming language. It means in C printf and Printf will have different meanings. C has a free-form line structure. End of each C statement must be marked with a semicolon. Multiple statements can be one the same line. White Spaces (ie tab space and space bar ) are ignored. Statements can continue over multiple lines.

hellow_world.c #include #include void main() { printf("Hellow World in C"); getch(); } Program Algorithm / Explanation 1. #include header file is included because, the C in-built statement printf we used in this program comes under stdio.h header files. 2. #include is used because the C in-built function getch()comes under conio.h header files. 3. main () function is the place where C program execution begins. 4. printf is used to display “Hellow World”. printf is the C in-built function, to display to the standard output device (Monitor). 5. Since C program execution happen in milliseconds, we cannot see the output (“Hellow World”) in the screen. That’s because Program output window closes immediately after execution. So we need a way to stop the program output window from closing. getch() will wait for keypress in our program execution and hence, we can see the result ”Hellow World”. After viewing the output we can close the output by pressing any key in the keyboard.

Programming Examples C Program to Calculate Area of Equilatral Triangle.

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R

#include #include void main() { int side; float area, r; r = sqrt(3) / 4; printf("\nEnter the Length of Side : "); scanf("%d", &side); area = r* side * side; printf("\nArea of Equilateral Triangle : %f", area); } C Program to find area , circumference of circle and perimeter of a circle. #include void main() { int rad; float PI = 3.14, area, ci,per; printf("\nEnter radius of circle: "); scanf("%d", &rad); area = PI * rad * rad; printf("\nArea of circle : %f ", area); ci = 2 * PI * rad; printf("\nCircumference : %f ", ci); per = 2 * PI* rad; printf("\n perimeter of a circle: %f ", per); getch(); }

2015 -2016

MODULE 1.pdf

PROGRAMMING IN C AND DATA STRUCTURES PREPARED BY SOMASHEKAR R 2015 -2016. 1: Write pseudo code that reads two numbers and multiplies ...

961KB Sizes 6 Downloads 246 Views

Recommend Documents

Module I Module II Module III Module IV Module V
THANKS FOR YOUR SUPPORT.MORE FILES DOWNLOAD ... Module VII. Marketing-Importance ,Scope-Creating and Delivering customer value-The marketing.

PART I Module I: Module II
networks,sinusoidal steady state analysis,resonance,basic filter concept,ideal current ... spherical charge distribution,Ampere's and Biot-Savart's law,Inductance ...

Module 4
Every __th person. •. People walking into store. Calculator. MATH ... number of apps A is between ____% and ____%. I am ___% confident that the average.

Coax connector module
Dec 8, 1994 - [73] Assignee: Berg Technology, Inc.. Reno. .... therefore be superimposed on the various information sig ...... CERTIFICATE OF CORRECTION.

Module 2 Summary 1 Running Head: MODULE 2 ...
change. By resisting today's ICT methods such as cell phones, Myspace, and Wikipedia, schools ... The only way to move forward effectively is to ... economic and business literacy; civic literacy; learning and thinking skills; creating the passion.

THE LUNAR EXCURSION MODULE
The Ascent Stage on top houses the two man crew and contains the equip- .... A digital LEM Guidance Computer (LGC), which accepts inputs {ram the IMU, AOT ... control during all phases of the mission with varying degrees of astronaut par-.

MODULE _excel.pdf
Sign in. Loading… Whoops! There was a problem loading more pages. Retrying... Whoops! There was a problem previewing this document. Retrying.

Fiber optic module
Jun 1, 1998 - converting the LD electric signal to an LD optical signal, a. PD module for converting a photodiode optical signal to a. PD electric signal, a PD ...

Module 4_QE.pdf
... TV programmes are causing. c the idea that TV adverts try to make you feel bad if you do not buy something to improve yourself. Page 3 of 9. Module 4_QE.pdf.

Module 4 -
Module 4. The “Big Picture”. For other scientists to understand the significance of your data/experiments, they must be able to: • understand precisely what you ...

Fiber optic module
May 15, 2000 - 12, 1995. US. Applications: ... See application ?le for complete search history. (56) ...... facturers to Support Common Footprint for Desktop FDDI.

Module 10_transcript.pdf
view the map with the occurrence points. To check whether all data points are accurate, he. downloads the occurrence dataset, and then cleans the data as we ...

Module 10 - nptel
explain the roles of each of the design parameters in increasing the strength capacities of column,. • name the two non-dimensional design parameters to ...

Sonar Array Module - GitHub
TITLE. DATE $Date: 2004/08/14 $. $Revision: 1.4 $. Dafydd Walters sonar_array_module.sch. Sonar Array Module. 3. 2. 4. 1. CONN1. Sonar 1. +5V echo trigger.

Module 15 Review.pdf
Page 1 of 3. Name: Period: ____ Date: You must show all work to get credit. Write your answers on the review handout. (this paper). Points possible: 20 pts.

Module 4.pdf
o A square with side length 1 unit, called “a unit. square,” is said to have ... Eureka Math, A Story of Units. Module 4 Sample ... Module 4.pdf. Module 4.pdf. Open.

Module 3 SCs.pdf
in Welsh means “How are you?”. In some regions of Scotland, some people use Gaelic as their first language (particularly in the. Highlands and the Western ...

Module 5 RA.pdf
... find sort of mild weather? a In Iceland in summer. b In Japan in spring. c In Sicily in winter. Whoops! There was a problem loading this page. Module 5 RA.pdf.

Module 3 RBS.pdf
There was a problem loading more pages. Retrying... Module 3 RBS.pdf. Module 3 RBS.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying Module 3 ...

ADS9850 Signal Generator Module - WordPress.com
AD9850_specification.pdf (From Page 9). 2. AD9850_SW_samples.zip. We also have demo board for this module for you. See the picture on the next page.