Ternary Operator : Sample Program Part 2

Ternary Operator

The video explains the method to use ternary operator in C program. What is important here is, programmer should not forget that conditional expression written using ternary operator returns the value.

Ternary operator is very handy operator to make the code consice in many situation not only in C but C++ and Java as well.

Access this framework with lot more stuff like C language MCQ, viva and interview preparation, Glossary, Solved Programs of C language etc. please register for discount coupon

cenglishcppengcmarathi

Logical AND (&&) operator

Logical && (AND) operator in C

एका पेक्षा अनेक कंडीशंन्स टेस्ट करायच्या असतील तर आपण नेस्टींग वापरतो. पण नेस्टींग सुद्धा काहीवेळा complex होत जाते. यावरच एक उत्तम उपाय म्हणजे logical operators चा योग्य ठिकाणी वापर. 

When two are more than 2 conditions are to be tested then logical AND operator gives you truth value when all conditions are true. In rest of the cases it would return 0 i.e. FALSE

Access this framework with lot more stuff like C language MCQ, viva and interview preparation, Glossary, Solved Programs of C language etc.

cenglishcppengcmarathi

Nested if else Part 02

sample program with flow chart on nested if else

Flow Chart is a graphical representation to depict flow of the control. It helps programmer to put the programming logic on the paper so that mistakes and bugs while writing source code can be minimised. The sample program reiterates the same while explaining real life program in C language.

Carefully observe how nesting of if else has been done to find grade obtained by student.

Access this framework with lot more stuff like C language MCQ, viva and interview preparation, Glossary, Solved Programs of C language etc. please register for Discount Coupon

cenglishcppengcmarathi

Nested if else 01

Introduction to nesting of if else control structure

एका पेक्षा जास्त conditions check करायच्या असतील तर एका if किंवा if else कंट्रोल स्ट्रक्चर च्या बॉडीमध्ये दुसरे if किंवा if else control structure लिहावे लागते. अशा प्रकारच्या पद्धतीला nesting असे म्हणतात. नेस्टींग हे अन्य कंट्रोल स्ट्रक्चर मध्ये सुद्धा असते. या ठिकाणी नेस्टिंग म्हणजे काय, कोणत्या ठिकाणी वापरायचे, कसे वापरायचे हे सर्व सांगीतले आहे.

There are many ways to write if or if else blocks inside if or else blocks. So infinite combinations will take place as per need and situation of the problem. Ultimately it is the logic put by programmer to design the code.

Access this framework with lot more stuff like C language MCQ, viva and interview preparation, Glossary, Solved Programs of C language etc.

cenglishcppengcmarathi

Chapter 2 : Unit 2 : Decision Control Structure Part 3

Chap 2 : Unit 2 : Decision Control Structure : Part 3

एखादी कंडीशन ट्रु झाली आणी एकच स्टेटमेंट त्या कंडीशनशी संलंग्न असेल तर त्यासाठी if condition नंतर कर्ली ब्रेस न टाकता स्टेटमेंट लिहीले तरी चालते. हेच तर या युनीट मध्ये समजावून सांगीतलय कारण समजायला सोपा पण implement करायला complex असे हे कंट्रोल स्ट्रक्चर आहे. कारण सोपे असल्यामुळे दुर्लक्षित राहीलेल आहे हे…  Register here to get Discount Coupon 

 

cenglishcppengcmarathi

Chap. 1 : Unit 3 : Introduction to Language: Part 2

Friends…. many students ask me why to learn C language in the era of .NET, Java, PHP, so my answer is when you learn C, you learn language fundamentals which are common to all languages in last 20 years. Same is explained here in this video.

Friends…. I discussed on operating system more than you might have hardly expected only because, we will be writing our C programs under DOS platform as well as recently developed IDE. Now just see the word platform…and how generically it is used….

As we already know, to run any application we need an operating system…. For cooking you need kitchen platform…or for swimming you need swimming platform…I mean without water can anybody swim…?

Now swimming platform may be different… like swimming pool, river, and lake or say ocean….but we need that….

To play games like cricket, football, hockey or tennis we need ground….

In the same fashion we need a platform in the computing world and here operating system performs that function…. And many times it is called as platform… Great know?

We might have heard about a few frameworks launched by Microsoft…. Like a .net framework…. A much hyped word these days among you programmers…. Just like talk of the town…. It is also manytimes called as a platform….!

Had you been to a gift article shop recently…? If yes you might have seen a frame… a photo frame…your job is to insert a photo of your choice in it…that’s all…. Sounds good know….just like plug and play…. No more hassles….

But my dear girls and guys ….we should not start our journey of learning merely by inserting only photos but instead learning how to build that frame itself…. So that we learn the foundation….and my dear friends…C provides that knowledge to understand the basics of all latest technologies like VC++, C sharp, J sharp, ASP dot net, PHP, python ….etc…

That is the reason we are going to learn C programming as a first language before learning any other technology….

And at the same time we are going to write our programs under the DOS environment as well as one IDE called C Free…. But does not matter whether it’s UNIX or Linux or DOS or window based platform

Because syntaxes and philosophy is same everywhere…. It’s like vanilla is base for any flavor of Ice-cream…. Other varieties would be added flavors like strawberry, Mango, chocolate.

Similarly learning C is important and flavors might be C under the DOS platform, C under Windows, C under UNIX, or even C under Linux ….

Syntaxes will be same with minor changes… in Nokia phones symbian C was also a new platform for writing mobile applications… and many components of android have been written in C and C++…

Access this framework with lot more stuff like C language MCQ, viva and interview preparation, Glossary, Solved Programs of C language etc. Register for Discount Coupon

cenglishcppengcmarathi

Chap 2 : Unit 1 : Introduction to Decision Control Structure : Part 2

There are basically 4 types of instructions in any C program. I have explained it in deail in the first chapter. Let’s have a review…

  • Type declaration
  • Input and output statements
  • Arithmetic Instructions
  • Control Structures

Here Control Structures are also of 4 types viz.

  • Sequential Control Structures 
  • Decision Control Structure 
  • Loop Control Structure
  • Switch Case Control Structure

In the first chapter all programs were simple and each statement of program was getting executed. So it is called as sequential control structure.  yes

Access this framework with lot more stuff like C language MCQ, viva and interview preparation, Glossary, Solved Programs of C language etc. please register for Discount Coupon

cenglishcppengcmarathi

Chap. 1 : Unit 6 : Sample C Program : Part 5

Here we will write one more program of calculating area of a circle. The idea of this program is to understand defining proper data types of variables in a C program. 

Here we need at least 2 variables. One for storing radius of a circle and other one for storing area of the circle. The data type of radius may be an integer or float but as formula of circle contains constant of PI which is 3.14, a floating point constant, the area variable must be declared as float or double to store the value. 

Access this framework with lot more stuff like C language MCQ, viva and interview preparation, Glossary, Solved Programs of C language etc. please register free (log in ) on Register / Login

cenglishcppengcmarathi