Posts

Showing posts from May, 2020

Int data type

Int data type int (1 sign bit + 31 data bits) keyword in C. it is used to define any positive or negative integer. According to Min, the size of int is 4 bytes which is equal to 32 bits 1 byte = 8 bits Integer is not int integer is a very very category of numbers whereas one 'int' has limited and exact amount of memory to store what is being represented by it. An int type variable in C is able to store only numbers till 2147483647. Int is a 32-bit data type when never a number is being assigned to an int type variable it is first converted to its binary representation (that is in 0's and 1's) that it is kept in memory at a specific location. An int is actually 1 sign bit + 31 data bits, that 31 bits are available for storing the number. 1 bit is represented for maintaining the sign of the number which is either + or - sign is also represented by binary digits 0-> +, 1-> - int num= 2147483647 will be converted in binary =11111111111111111111111111111111 31 digits a...

Size of Operator in C

Size of the operator in C Size of is simply returns the amount of memory allocated to data type or variable. It is a compiler time unary operator. It can be applied to any data type like integer type, float type, pointer, and also to arrays and structure. The output depended on your machines, different machines have different output of the same data type. Example: #include<stdio.h> int main() { int a=1; double b=12.5; printf("Size of char is %lu", sizeof(char)); printf("Size of int is %lu", sizeof(int)); printf("Size of float is %lu", sizeof(float)); printf("Size of double is %lu", sizeof(double)); printf("Size of a+b is %lu", sizeof(a+b)); return 0; } Output: Size of char is 1 Size of int is 2 Size of float is 4 Size of double is 8 Size of double is 8   The size of the operator also use to find the length of the array and allocate a block of memory. Example  to finding number of element in array #include<stdio.h> int main()...

Operator in C

Operators are foundation any programming language. The functionally C programming language is incomplete without the use of the operator. Operators are symbols that help us to perform specific mathematical and logical computations on the operator. Operator Symbol Operator Name Operator Type ++, -- Unary operator unary operator +, -, *, /, % Arithmetic operator Binary operator <, <=, >, >=, ==, != Relational operator Binary operator &&, ||, ! Logical operator Binary operator &, |, <<, >>, ~, ^ Bitwise operator Binary operator =, +=, -=, *=, /=, %= Assignment operator Binary operator ? : Ternary operator Ternary operator Unary operator: operator that o...

Keyword in C

Keyword in C Keywords are specific reserved words in C. Every keyword was a specific feature associated with it. Almost all of the words which help us to use the Functionality of the C language. There are a total of 32 keywords in C. int for auto enum float while void volatile char do signed return long break unsigned sizeof double continue static struct switch register union default exten if const else volatile case short goto Most of these keyword have already known to you and we discussed in the various parts of C like Datatype, storage, classes, control statement, and functions.

Identifier

Identifier An identifier is a string of alphanumeric characters that begin with an alphabetic character or underscore character that are used to represent various programming elements such as variable, Functions, array, structure, unions and so on. An identifier is a user-defined word. Also remember identifiers must be unique. They are created to give a unique name to an entity to identify it during the execution of the program and the identifier name must be different from the keyword. Rules for naming identifiers. An identifier can have letters both uppercase and lowercase letters, digit, and underscores. The first letter of an identifier should be a letter or an underscore. You can not use the keyword as an identifier. Identifier names must be unique. Example of identifier. int sum; float average; function name void sum_of_twonumber(); void _student(); int main() { int a=99 printf("%d",a); } Above program has two identifiers. main as a function n...

enum in C

Enumeration in C Enumeration (or enum) is a user-defined data type in C. It is mainly used to assign names to integer constants, the names make a program easy to read and maintain. The keyword enum is used to declare an enumeration syntax of enum.     enum enum_name {cons1, cons2, ... }; The enum keyword is also used to define the variable of the enum type. There are two ways to define the variables of enum types as follows. Declaration: enum  week {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}; enum week day;           //initialization Now in the above declaration Monday is assigned to 0, Tuesday is assigned to 1, Wednesday to 2, and so on at the and Sunday is assigned to 6. Compiler By default assigns values starting from 0. Example  to understand the working of enum in C. #include<stdio.h> enum week {Mon, Tue, Wed, Thus, Fri, Sat, Sun}; int main() { enum week day; day=Fri; printf("%d", day); return 0; } Output: 4 In above ex...

Projections Of Line Most Important Diagram

Image
Projections Of Line Most Important Diagram The most important diagram showing graphical relations among all important parameters of this topic. Study and memorize it. And use in solving various problems. True length (TL)-a'b,'& ab Angle of TL with hp- θ Angle of TL with VP- Ø Angle of FV with XY- α Angle of TV with XY - β  LTV (length of FV)-component (a-1) LFV (length of TV)- component (a'-1') Position of A- distances of a & a' from XY Position of B-distances of b & b' from XY Distance between end projectors Note this θ & α construct with a' Ø & β construct with a b' & b 1 '  on the locus. b & b 1  on the same locus. also remember True length is never rotated. its horizontal component is drawn & it is further rotated to locate the view. Views are always rotated, made horizontal & further extended to locate TL,θ & Ø Please write comments if you find anything incorrect and if you h...

Problems On Isometric Projections

Image
Problems On Isometric Projections 1 ] Projections of frustum of the pentagonal pyramid are given, draw it's isometric view. Solution Steps: First draw isometric of its base. Then draw the same shape as a top, 60mm above the base pentagon center. Then reduce the top to 20mm sides and join with the proper base corners. 2 ] Projections of a frustum of the cone is given, draw it's isometric view. Solution Steps: First draw isometric of its base. Then draw the same shape as a top, 60mm above the base pentagon center. Then reduce the top to 20mm sides and join with the proper base corners. 3 ] A square pyramid of 30mm base sides and 50mm long axis, is centrally placed on the top of a cube of 50mm long edged. Draw the isometric view of the pair. 4 ] A triangular pyramid of 30 mm base sides and 50 mm long axis, is centrally placed on the top of a cub of 50 mm long edges. Draw the isometric view of the pair.  Solution steps To draw isometric of a cube is simple. dra...

Isometric Projections

Image
Isometric Drawing Isometric Drawing is a type of pictorial projection in which all three dimensions of an object are shown in one view and if required, Their actual sizes can be measured directly from it. 3D drawing can be drawn in numerous ways as shown below, All these drawings may be called 3 Dimensional drawings, photographic or pictorial drawings. Here no specific relation among H, L & D axes is maintained. Typical Condition In this 3D drawing of an object, In which all three dimensions axes are maintained at equal inclinations with each other. ( 120º ) Now observe below-given drawings. One can note specific inclination among H, L & D axes. Iso means the same, similar or equal. Here one can find dual inclination among H, L & D axes. Each is 120 inclined with the other two. Hence it is called isometric drawing. Some im portant terms Isometric axes, lines, and planes The three lines AL, AD, and AH, meeting at point A and making 120 º angle with each other termed Isometr...

Examples on Interpenetration of solids

Image
Interpenetration of solids The following cases are solved. refer illustration and note the common construction for all Cylinder to cylinder 2. Sq.prism to cylinder Cone to cylinder Triangular prism to cylinder Sq.prism to sq.prism Sq.prism to sq.prism(skew position) Square prism to cone (from top ) Cylinder to cone Common solution steps One solid will be standing on HP other will penetrate horizontally. Draw three views of standing solid. name views as per the illustrations. Beginning with side view draw three views of penetrating solids also. On its S.V. mark number of points and name those (either letters or nos.) The points which are on standard generators or edges of standing solid, (In S.V.) can be marked on respective generators in FV and TV and other points from SV should be brought to TV first and then projecting upward to FV. The dark and dotted line's decision should be taken by observing the side view from its right side as shown by the arrow. Acc...

Examples On Sections And Developing Of Solid | Application Of Projections Of Solid.

Image
Examples On Sections And Developing Of Solid Engineering Application Of Projections Of Solid. 1 ] A pentagonal prism, 30 mm base side & 50 mm axis is standing on hp on its base whose one side is perpendicular to VP. it is cut by a section plane 45 º inclined to hp, through midpoint if axis draw FV, sec.TV & sec. side view. also draw the true shape of section and Development surface of remaining solid. Solution steps: For section views: Draw three views of standing prism. Locate sec. plane in FV as described. Project points where edges are getting cut on TV & SV as shown in the illustration. Join those points in sequence and show section lines in it. Make the remaining part of the solid dark. For True shape: Draw x 1  y 1 || to sec. plane Draw projectors on it from cut points. Mark distance of points of sectioned part from TV, on above projectors from x 1  y 1 , and join in sequence. Draw section lines in it. It is required true shape. For Development: Draw the developmen...