Posts

Showing posts from May, 2022

CHAPTER 3 Conditional Instruction

Image
  What us conditional instruction in c language ? CONDITIONAL INSTRUCTION Sometimes we want to watch comedy videos on Youtube if the day is Sunday Sometimes we order junk food if it is our friend’s birthday in the hostel You might want to buy an umbrella if its raining and you have the money you order the meal if dal or your favorite bhindi is listed on the menu. All these are decisions which depend on a condition being met. In c language too, we must be able to execute instructions on a condition being met. learn c programming Ques1 :-What are decision making instructions in c? Decision Making Instructions in C if-else statement switch statement Ques 2 : -What is if-else statement in c ? if-else statement The syntax of an if-else statement in C look like: if (condition to be checked) { statement-if-condition- true; } else{ statement-if-condition-false; ] code example:- int a= 23; if (a>18){ printf(”you can drive\n”); } Note that else block is not

Chapter 2: Instruction and operators

Image
                          Instruction and Operators  A  c program is a set  of instructions. just like a recepie-Which contains instructions to prepare a particular Dish. Types of instruction  1.Type declaration Instruction 2. Arithmetic Instruction 3. Control Instruction Type declaration Instruction int a; float b; Other varities: i nt i=10; int j=i ; int a=2 int ji=a+j-i ; float b=a+3 ; float =1.1***ERROR ! as we are trying to use before defining it *** int abcd ;  a=b=c=d=30 ;*** value of abcd will be 30 each*** Airtmetic Instruction  int i=(3*2) +1 "*" "+"             **** these are operators*** "3,2,1"               ***these are operands*** operands can be int /float etc. +,-,*,/ are arthmetic operators int b=2, c=3; intz; Z=b*c;              ***legal*** intZ; b*c=z;              ***Illegeal*** % --->Modular division operator  %---.> Returns the reminder  %---> Cannot be applied on float %---> Sign is same as of numerator 5%2=1    -5%2=-1

Chapter 1 "C programming"

Image
 Hello guys this is the first chapter of c programming , In this chapter we will learn about basics of c programming  ; Here we go to learn c language,                 Chapter 1 Variable, contest &keywords                   Variable :- A Variable is a container which stores a 'value' Like in kitchen we use containers storing rice ,Dal,Suger etc. Similarly, To that Variable in c Stores  Value of a constast . Example: A=3;      //a is assinged"3" b=4.7;    //b is assigned "4.7" c='A' ;    //c is assinged "a" Rules of naming variable in C :- 1. First character must be an alphabet or underscore(_). 2. No commas , blanks allowed  3.  No special symbol other than (_) allowed. 4. variable names are case sensitive  We Must create  meaningful variable names in our programs. This enhance raedabibly of our programs. Ques: What is variable in c ? Ans:   Variable is basically nothing but  the name of a memory location that we use for storing data .

My work in c programming

Hello  dear, I am sourabh Sangwan student of bca in second semester and learning c programming and also making notes and c programming projects