Showing posts with the label Steps of learning C language

Operators in C Language

Observe the given expression y = x + 5. In the above given expression +, = are the operators and x, y, 5 are called operands / argument.Types of operatorAccording to the required argument the operator can be classified into 3 categories:unary operator: require only one argument. example(-5)binary operator: require two argument. example(5+8)ternary operator: require 3 argument. example(?:)According to the purpose operator are again classified into 8 types:Arithmetic operatorUnary operatorAssignment operatorRelational operatorLogical operatorBitwise operatorConditional operator(ternary operator)Comma operatorArithmetic operator+,-,*,/,%(mod) are called the arithmetic operator.The +,-,* are same as you learn in mathematical Arithmetic.To more understand take an example.5 + 3 * 4In the above given expression, which operator should be evaluates first? As in mathematics you learn the rule of BODMAS,which tells first brackets should be evaluated, then divide,after that Multiply,addition and …

Variable in C programming

What is variable?Variable is an entity which can change during the program execution.ORVariable is the name of the memory place, where data is stored.ORVariable is just like a cup of tea.How to create a variable int x;
float y;
char z; General Syntaxdatatype variable_name;As shown in the above snippet, To create a variable two things are needed...Data typeVariable nameRules for creating variable nameVariable name can contains Alphabets(A-Z / a-z), Digits (0-9), and Underscore (_).Variable name must begins with an Alphabet or UnderscoreSpaces and Special symbols are not allowed.Keywords / Reserved words are not allowed as a variable name.Variable name should be meaningful.C is a case sensitive programming language, so age, Age, AGE all are different variables.Some valid / invalid variable names are listed below...Variable nameValid / Invalidnamevalidfather_namevalidfather's nameinvalidfather's_nameinvalidavg.invalid2personsinvalidperson1validintinvalidintegervalidintnumvalidFLO…

Constant in C Programming

Constant is an entity which never changes in the given problem or program.Types of ConstantThere are basically two types of constants in C.Scalar/ Primitive/ PrimaryCompositeThe Scalar types of constant are those which can't be divided any more and the composite constant are those which can be divided into multiple scalar constants. In this article, we only discuss the Scalar/Primitive constant.The Composite constants are discussed later.1. Integer ConstantA number without any fractional part is called Integer constant.Example: 25, 0, -44, 456 etcRules of Integer ConstantNo decimal points are allowed. Example 25 is correct but 25.0 is incorrect.Rules of Integer Constant +ve/-ve both types of values are allowed.Special, Comma and other characters are not allowed. Example 2 3 4 and 12,500 are incorrect.Valid Range: -32768 to 327672. Floating point constant or real constantCan contain decimal point +ve/-ve both types of values are allowed.Special, Comma and other characters are not a…

Constant and Variable

y = x + 5, See the expression carefully.It is clear that if we change the value of x the value of y is also changed but the 5 remains the same every time.So, x and y are the variables but 5 is a constant.PreviousBack to C Programming indexNext

Keywords in C language

Keywords are some words, which meaning is already reserved by the compiler. So these words are also called reserved words. In C, there are 32 keywords as listed below.autodoubleintstructbreakelselongswitchcaseenumregistertypedefcharexternreturnunsignedconstfloatshortunioncontinueforsignedvoiddefaultgotosizeofvolatiledoifstaticwhilePreviousBack to C Programming indexNext

Character Set

The allowed set of characters is called the character set.C character set consist of the following character.AlphabetsA-Z , a-zDigits0 - 9White SpacesSpaces, tabs, newlines etc.Special Symbols+, -, *, /, %, _,; and many more discussed as needed.PreviousBack to C Programming indexNext

Steps of learning C Programming

Steps of learning EnglishAlphabets => Words => Sentence => ParagraphSteps of learning C languageCharacter Set => Keywords/ Constant/ Variable => Instruction => Program PreviousBack to C Programming indexNext

Printing in C programming

Printing in C In C for printing purpose, We Use A Function Called printf( ). A function is a small program used to perform a specific task. The function receives some input known as an argument and produces some output called return value. Functions are always suffixed with parenthesis ( ).Syntax of printf( )printf("Control String",[List or Variable]);Note: Control string is a sequence of characters which you want to print. ([ ]) square brackets around the list or variable represent that it is optimal.Example Of printf( ) printf("hello"); //Print hello int a=5,b=6; printf("a=%d b=%d",a,b); //print the value of a and b. int a=5,b=6; //Varialbe Declaration printf("%d",a+b); //Print 11. Note:In printf( ) expression can be written .The example is given above. The first program, Say Hello World in C programming /*program to print the "Hello world"*/ #include<stdio.h> int main() { printf("Hello World"); return 0; …

Popular posts from this blog

Program to calculate telephone bill

Arrays in C Language

String in golang

Sum of two numbers in go lang

Pointers in C Language

Decision Making Statements

Say Hello world in Go lang

Decision Making in Go lang

Program to convert time from seconds to hours, minutes and seconds

Installing go lang