Posts

SQL Operators

Operator The purpose operators is to perform the manipulations with attributes. These Operators are following 1. Relational Operators - for comparing purpose 2. Arithmetic Operators - for mathematical operations 3. Logical Operators - for compare with multiple conditions or opposition conditions 3. Special Operator - for special purpose comparison Relational Operators >, <, >=, <=, =, !=, <> Examples: Display the details about employee whose name is SMITH select *from emp where ename='SMITH'; Display the details about employees whose salary is greater than 3000 select *from emp where sal > 3000; Display the details about employees except MANAGER select *from emp where job <>'MANAGER' ; or select *from emp where job !='MANAGER' ; Arithmetic Operators +, -, *, / Logical Operators and, or , not Example Display the details about MANAGERS whose salary is greater than 2500 select ename, job, sal from emp where job='MANAGER' and sal...

Functions

  What is Function ?    In a Program to perform articular task number of times which is having more number of statements, instead of writing those statements number of time we can define a sub routine called Function. The purpose of function is reusability. Function has three parts 1. Function declaration - before the main() 2. Function Calling - within the main() 3. Function Definition - after the main() Functions are following categories 1. Functions with no arguments, no return value 2, Functions with arguments, no return value 3. Function with arguments and return value while giving the function definition we can use as follows    type specifier function_name(arg1,arg2,...)    {       statements;    } In the above type specifier represent what type of value the function is going to return. If the function can't return any value we can represent with void otherwise we can use any related data type. to return the va...

Introduction to Database Oracle

Example Programs for Control Flow Statements

Image
  //Find out sum of two numbers is even or odd main() { int n1,n2,sum; printf("value for n1"); scanf("%d",&n1); printf("value for n2"); scanf("%d",&n2); sum=n1+n2; if(sum%2==0) printf("\n%d is even",sum); else printf("\n %d is odd",sum); } //Accept a character and check whether it is vowel or not main() { char c1; printf("Enter a character"); scanf("%c",&c1); switch(c1) { case 'a': case 'A': case 'e': case 'E': case 'i': case 'I': case 'o': case 'O': case 'u': case 'U': printf("\n%c is vowel",c1);           break; default:printf("\n%c is not vowel",c1);           break; } } // display the numbers between 1 and 10 main() { int n; for(n=1;n<=10;n++) printf("%d ",n); } // display the numbers between 1 and 10 usi...

Control Flow Statements

Control Flow Statements Same Control Flow Statement we can call Programming Constructions. Programming Constructions represent how the program is goin to execute. There are three programming constructions 1. Sequence 2. Selection 3. Iteration 1. Sequence : Without any conditions if the statements are executed then that process is called Sequence. Example : Accept two numbers display sum of those  or interchange 2. Selection: Based on the condition if the execution control is changed from one place to another place then it is called Selection. For this purpose we can use Conditional Statements. 3. Iteration: Executing some set of Statements number of times is called Iteration or Repetition. For this purpose we can use Looping Statements  Conditional Statements : based on the condition execution control is changed from one place to another place for this purpose we can use conditional statements if, switch Syntax-1 if(condition)    statement; else    statemen...

My Channel Trailer

Image

Operators in C

Operators in C The purpose of operators is to perform the manipulations with operands(variables) Operators are following 1 . Relational Operators - For comparing purpose , >,<,>=,<=,==,!= 2.Assignment operator - = 3.Arithmetic Operators - to perform mathematical operations +,-,*,/,% 4.Logical Operators - to compare with multiple conditions or opposition conditions                          &&(and),||(or),!(not) 5.Bitwise Operators - to perform the manipulations with binary data(1s and 0s)    &(bitwise and),|(bitwise or),^(xor),<<(left shift operator),>>(right shift operator ) The following truth table explains how logical operators and xor operator gives the result. Let us take there are two inputs P and Q   P      Q       P&&Q     P||Q     P^Q   0      0      ...