Posts

Showing posts from April, 2024

Type conversation and casting

Type conversation and  type casting  :- (i).  Type Conversion. :- The type conversion is the process of converting a data value from one data type to another data  type automatically by the compiler. Sometimes type conversion is also called implicit type conversion. The implicit type conversion is automatically performed by the compiler. For example, in c programming language, when we assign an integer value to a float variable the  integer value automatically gets converted to float value by adding decimal value 0. And when a  float value is assigned to an integer variable the float value automatically gets converted to an  integer value by removing the decimal value. To understand more about type conversion observe  the following... int i = 10 ; float x = 15.5 ; char ch = 'A' ; i = x ; =======> x value 15.5 is converted as 15 and assigned to variable i x = i ; =======> Here i value 10 is converted as 10.000000 and assigned to variable x i ...

decision making statemant

  What is Decision Making Statement? In the C programming language, the program execution flow is line by line from top to bottom. That means the c program is executed line by line from the main method. But this type of execution flow may not be suitable for all the program solutions. Sometimes, we make some decisions or we may skip the execution of one or more lines of code. Consider a situation, where we write a program to check whether a student has passed or failed in a particular subject. Here, we need to check whether the marks are greater than the pass marks or not. If marks are greater, then we decide that the student has passed otherwise failed. To solve such kind of problems in c we use the statements called decision making statements. Decision-making statements are the statements that are used to verify a given condition and decide whether a block of statements gets executed or not based on the condition result. n the c programming language, there are two decision-making...