0% found this document useful (0 votes)
9 views151 pages

Hhtmlnote

The document provides an overview of the C programming language, including its history, software requirements, and key concepts such as compilers, header files, keywords, and data types. It also covers programming structure, input/output methods, operators, control statements, loops, arrays, and string manipulation. Additionally, it includes examples and explanations of various programming constructs and functions in C.

Uploaded by

SK Gamer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views151 pages

Hhtmlnote

The document provides an overview of the C programming language, including its history, software requirements, and key concepts such as compilers, header files, keywords, and data types. It also covers programming structure, input/output methods, operators, control statements, loops, arrays, and string manipulation. Additionally, it includes examples and explanations of various programming constructs and functions in C.

Uploaded by

SK Gamer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 151

C Programming Language

1. Concept of C:-
• C is a high level language.

• C is a General purpose programming language.

• C is developed by Dennis Ritchie in year 1972 at AT & T Bell Lab (USA).

2. Software requirement for C Language:-


There are multiples software’s for c programming language –
• TurboC++

• DevC

• Netbeans

• Visual studio……etc.

3. What is compiler:-
Compiler is an application that is used to convert Source code into Machine code.

Diagram of compiler:-
Machine code
Source code
.c/.cpp

Compiler:-

4. Header Files:-
Header files are also known as library files. It contains pre-define functions the extension
of header file is .h.
Example: stdio.h, conio.h, graphics.h, math.h, windows.h, string.h...........etc.

Note: - Into TurboC++ compiler header files are saved into includes folder.
5. Keywords:-
Keywords are reserve words. The meaning of keywords is pre define into the compiler.

There are 32 keywords that are given below –

Auto break case Char continue const do while

For int float enum struct switch if else


Typedef extern goto Void union unsigned volatile return
Register short signed sizeof static long double default

How we can write C programming Language:-


Step 1: Documentation section (optional block)

Step 2: Header section (essential block)


Step 3: Global section (optional block)

Step 4: main section (essential block)

[IPO]

I stand for Input

P stands for Processing


O stands for Output

Step 5: UDF section (optional block)

UDF stands for User Defined Function

Input and Output methods in C language:


• Input method :
Input method that is use to take the input from user is called input method.

Example: scanf(),gets(),getch(),getchar(),getche().........etc

• output method:

Output method is use to display the output on console.


Example: printf (), puts (), putchar (),...etc.

Program 1
Save file name:-pro1.c

#include<stdio.h>

#include<conio.h>

void main ()

clrscr();
printf(“Welcome to C Programming Language”);

getch();

Explanation of Program1

#include<stdio.h>
#: Pre-processor directive (means link).

includes: folder name: where all header files are saved.

<>: angular bracket: it contains built-in code.

studio: header file name.

.h: header files extension.

void: void is a keyword and data type but it is empty data type.
main (): main is a user defined built-in function.

getch(): it is used to input a character on console window.

Variables:-
Variables are memory place holder. The value of variable can be changed during the
program execution.
Rules for variable declaration:

1. Variable cannot starts with keyword. .

Example:-

int while; //invalid

int a; //valid

2. Space is not allowed between variable declarations.


Example:-

int a b; / /invalid

int ab; //valid

int a_b; //valid

3. Variable cannot starts with number.

Example:-
int 1a; //invalid

int a1; // valid

4. If you want to separate of variable then we used comma (,) operator.

Example:-

int ab; // single variable

int a, b; //separate operator

High level language: - High level language is human readable language.

Low level language: - Low level language is not human readable language its mean it is
display in binary format.

Date: 19/10/2020

Operators in C language:-
Operators are use to performs the operations between operands.

Example:-

x+y;

x, y (operands) [Operands are also known as variable]


+ (operator)

Note: boxing (smallest to biggest) and unboxing (biggest to smallest)

Typecasting: smallest to biggest.

Types of Operators:-
There are many types of operator -

• Arithmetic Operator

• Logical Operator

• Relational Operator

• Conditional Operator

• Bitwise Operator
• Increment/Decrement Operator or Unary/Binary Operator……etc.

• Arithmetic Operator:-

Arithmetic operator is use to perform arithmetic operation.

• + plus operator

• – minus operator

• * multiplication operator(astric operator )


• / division operator(calculate quotient)

• % modulus operator(calculate remainder)

• Logical Operator:-

Logical operator is used to define the logical operation.


• || OR operator(pipe operator)

• ! NOT operator

• && AND Operator

• Relational Operator:-
Relational operator is used to represent the relation between two entities.

Operator entities with operator

• > greater than a>b

• >= greater than or equal a>=b

• < less than a<b

• <= less than or equal a<=b


• == equality a==b

• Conditional Operator:-

Conditional operator is also known as ternary operator. It is used to check the


condition without using conditional statement.

Syntax of conditional operator:-

(Condition)? true block: false block;

Example:-

(a>b)? a: b;

5 Increment and decrement operator:-

Increment operator is used to increase a single into a real value.

Example:-

Int x; int y;
x=2; y=2;
x++; => x=x+1; y--; //y=y-1;

x+=3; [short hand operator]

Date – 6/11/2020
6 Bitwise operator:-

The bitwise operators are the operators used to perform the operations on the
data at the bit-level.

Operator Meaning of operator


| Bitwise OR operator
& Bitwise AND operator
^ Bitwise exclusive operator
~ Ones complement operator(unary operator)
>> Right shift operator
<< Left shift operator

Performance:-

X Y X&y X|y X^y


0 0 0 0 0
0 1 0 1 1
1 0 0 1 1
1 1 1 1 1

Data type in C:-

Data type is used to define the type of data. There are two types of data type-

1 built-in data type/basic/Fundamental

Example:

• Int, float, double, char …etc.


2 User define data type

Example:

• union, struct, array, pointer ……etc.


Date - 20/10/2020

Statement:-
Statement is block that is executed by compiler.

Types of statement:-

• Conditional Statement(Decision making statement)

• Loop/Iterative control statement

• Jump control statement

Control statement:-
The statement that is used to check the conditions that are conditional statement or
decision making statement.

There are two type of control statement-

• if statement
• switch statement

• if statement:-

• simple if

• if else

• else if(ladder if)

• nested if

• Simple if:-

It check only true block.

Syntax:-

if (condition)
{

//block of code

• if else:-

if given condition is true then true block of code will be executed otherwise else
block of code will be executed.

Types of if statement:-

• Simple if

• If else

• else if//ladder if
• Nested if

• Syntax of simple if: -

If check only true block.

if(condition)

{
//block of code

• Syntax of if else :-

if(condition)

{
//block of code //true block
}

else

//block of code //False block}

• Nested if statement:-

if(condition)

if(condition)
{

//block of code

else

//block of code
}

else

//block of code

• else if:-

Syntax:-

if(condition1)//true block
{

//block of code

else if(condition2)//true block


{

//block of code

else if(condition3)//true block

//block of code
}

else

//block of code//false block

• jump control statement:-

It is used to move compiler from one place to another place.

Types of jump control statement:-

• break statement
• continue statement

• goto statement

• break statement:-

break is a keyword that is used to break of nextline execution.

Syntax:-
break;

Example:-Print 1 to 10 number by using break statement but given condition is 7

#include<stdio.h>
#include<conio.h>

void main()

int i;

clrscr();

printf(“Display Number\n”);
for(i=1;i<=10;i++)

if (i==7)

Break;

}
printf(“%d\t”, i);

getch();

2 continue statement:-
It is used to continue of statements instead of given condition.

Syntax:-

continue;

Example:-Print 1 to 10 number by using continue statement but given condition is 7

#include<stdio.h>
#include<conio.h>

void main()

int i;
clrscr();

printf(“Display Number\n”);

for(i=1; i<=10; i++)

if (i==7)

{
continue;

printf(“%d\t”, i);

getch();

3. goto statement:-

goto statement is working on level. It is used to jump from one level to another level.

Syntax:-

levelVarName:

//block of code
goto levelVarName;

Example: - int x;

x:

printf("welcome");

goto x;
Program 3 WAP in c to use of goto statement

#include<stdio.h>

#include<conio.h>

void main()
{

int i;

clrscr();

printf("Display numbers from 1 to 20\n");

i=1;

x:
if(i<=20)

printf("%d\t", i);

i++;

goto x;

}
getch();

Date - 21/10/202

Loop control statement:-

• index based loop


• collection based loop

• Loop control statement is also known as iterative statement.

Definition:-
When any statement execute again and again on behalf of condition then we
used loop.
Control statement:-

What steps are used in every loop control statement -

1. Initialization

2. Condition
3. Updation

Initialization - starting point of loop

Condition - range of loop

Updation - increment/decrement

Types of control statement loop:-


1. Types of index based loop:-

There are two types of loop control statement-

• entry control loop

• exit control loop

2. Types of collection based loop:-

• for each loop


It is not support c/c++.

1. Entry control loop:-

The loop control that is check the condition at entry point is called

the entry control loop.

• while loop:- while is a keyword. It’s working as an entry control loop.

Syntax:-
Initialization;

while (condition)

//body of loop

Updation;
}

• for loop :-
for is also a keyword. It checked the condition, initialization and updation into a
single line. Separate by semicolon. The working of for loop and while loop is same but
Syntax is differ.

Syntax:-

for (initialization; condition; updation)

//body of loop

Exit control loop:-

Exit control loop check the condition at a last point.

Body of loop will be executed once time therefore conditions true or false.

Syntax of do while loop:-

It is also a keyword.
Initialization;
do

//body of loop

Updation;

} while (condition);

Date - 22/10/2020

Array in C:-
A single variable can hold only single value. If you declare that variable as an array then
that can holds multiple values of same data type.
Note: - Array is the collection of similar data type.

Syntax:-

Data_type ArrayName [size];

Example:-

int num [5];

char name [20];

Initialization of an array:-

The initialization of an array starts from zero to n-1. Where n is the size of an array.

Name [0]='R'..........

Name [19]='T'

How many types an array:-

There are following type of an array-

1. Single dimensional array/1D array

2. Two dimensional array/2D array

3. Multi-diamensional array/3D array

4. Parameterized array/prams array


5. Jacked array...........etc.

//write a program in c to use of an array initialization

#include<stdio.h>

#include<conio.h>
void main ()
{

int list [10];

int n, i;

clrscr ();
printf ("Enter the size of list :");

scanf ("%d",&n);

for(i=0; i<n; i++)

printf ("Enter number :");


scanf ("%d",&list[i]);

list[i]=100*list[i];

printf ("display of addition: \n");

for (i=0; i<n; i++)

{
printf ("list [%d]=%d\n", i, list[i]);

getch ();

Notes:-

• One sub-script =1D Array


• Two sub-script=2D Array

• or more subscript=Multi-Dimensional array

• Array pass as parameter in Function=params Array


Date: 23/10/2020

2D Array:-
It have two subscript .one is used for number of rows and second is number of
columns.2D Array basically used for matrix representation

Syntax of 2D Array:-

Data-Type ArrayName [rows][column];

Example:-

int n [3][2];

Nested Loop:-

When any loop is available in to another loop then this process known as nested
loop.

• First loop is called outer loop and second loop is called inner loop.
• When outer loop executes once a time then inner loop executes full time
according to condition.

Syntax of nested loop:-


for (initialization; condition; updation)//use for row/outer loop

for (initialization; condition; updation)//use for column/inner loop

{
//block of code

Date 24/10/2020

Some mathematical Function//math.h header file


• sin()

• cos()

• tan()

• log()

• floor()

2. Boot methods:-dos.h header file

• sound ()

• nosound()

3.Disigning methods :- conio.h header file

• cprintf ()
• textbackground()

• textcolor().....etc;

Multidimensional Array:-
Multidimensional array, when two or more sub-script is available into an array
then that is called Multi dimensional array.

Syntax:-

Data_Type Array_Name [s1][s2][s3].........

Date - 26/10/2020

String in C:-

String is the char type array. String is identify by %s symbol.

Syntax of character in C:-

char StringName [size];


Example:-

char name [30];

Some built-in methods in C:-

1 gets ()

2 puts ()

3 strupr ()
4 strlwr ()

5 strlen ()

6 strcpy ()

7 strcmp ()

8 strrev ().......etc

Note: - These all methods are available (string.h) header file.


1. gets () and puts ():-
It is used to take input of string type and puts () method is used for display string
on console window.

Syntax:-

puts ("string value");

Syntax:-

gets (charTypeArrayName);

2. strrev ():-

It is used to reverse of any string. strrev () method is also available into string .h header
file.
3. strcpy ():-

If you want to copy one string into another string then we used this method.

Syntax:-

strcpy (TargetString, SourceString);

Example:-

char str1 [20],str2 [20];


strcpy (str2, str1);

return type of strcmp () method:-

• 0 (str1==str2)

• 1 (str1>str2)

• -1 (str1<str2)

4. strcmp ():-

Syntax:-

strcmp (str1, str2);


Date - 28/10/2020

Function - Fun + Action


It is backbone of programming language .Function is the block of code. It has a
particular task.

Type of Function:-

1. Built-in Function

2. User Define Function

1. Built-in Function:-

Built-in Function is also known as library Function. It is already define into header file.

Example:- printf(),scanf(),gets(),puts(),getch()......etc.

2. User Define Function:-

The function that is define by user is called the user define function.

Type of UDF:-

1. No return type and no passing parameter

2. No return type but passing parameter

3. return type and no passing parameter

4. return type and passing parameter

Syntax of UDF:-

Return_Type FunctionName (parameter)

//block of code

}
Notes:-

• void is a data type and no return type data type.

• main() is also no return type and no passing parameter.


• No passing parameter type me output us block me nhi likhate h matlab main ()
me likhate hai.
• Passing parameter me input us block me nhi lete h matalb main () me input lete
hai.

Prototype:-

The calling of function that is called prototype function

Main point of function:-

• Declaration

• definition

• calling

Note:-
1. If any function having parameter then input of that variable is not available inside of
function.
2. When any function returns any value then output of that function is not print inside of
function. If you want to return any value to the function then we used return keyword

1. No return type and no passing parameter:-

Return-type FunctionName (no passing parameter)


{

//block of code
}

Example:-

void add()

{
//block of code

2. No return type but passing parameter

void add (int a, int b)//a, b formal value

{
//block of code

• actual value coping formal value this process is called swapping

Note:-Parameter means input

Task
1. Find the sum of following series

1/1!+2/2!+3/3!+....................n term

2. Find the value of ncr

ncr=n!/r!(n-r);

3. Create a UDF of prime () into mt.h header file by using last 3 type of UDF.
Prime number.

Date -30/10/2020

Structure:-
Structure is the similar or dissimilar data type.struct keyword is used to define the
structure. Struct is also a user define data type.
Syntax:-

struct StructureName

Data_Type VarName1;

Data_Type VarName2.......;

} StructureVarName;

Example of structure:-

struct student

int rollNo;

char name [80];


}s;

Example:-

void main()

int rollNo;
scanf("%d",&rollNo);

but

in structure

scanf("%d",&s.rollNo);

}
Union:-

Union is same like structure but it have the size as big size of data member

Syntax of union:-
union UnionName

Data_Type VarName;

Data_type VarName2;

................

} UnionVariableName;

2. Structure me jitne bhi variable honge sbko jodkr structure ki size define kiya jata hai
but union me jis variable ki size sbse bdi h usi ko define krta hai. Union ka use memory
utilisation ke liye kiya jata hai.

Structure within Array:-

Syntax:-
struct StructureName
{

variable;

} StructureVariable [size];

Example:-
struck student

int id;

char name [40];


}s[20];

Note:- switch ke andar hm kewal char ya int pass kr skte hain.

Date – 02/11/2020
Recursion: -

When any function called itself within scope then that function is called Recursive
function and this process is known as Recursion.

Example:-
int fact (int n)

return (n*fact (n-1));

Calling of Functions:-
• call by value

• call by reference

• call by value is used to UDF

• call by reference is used to pointer

Pointer:-
Pointer is variable which holds the address of another variable. Pointer have two
symbols-

& (ampersand) – holds the address of variable into memory

*(astric) – holds the value of block


Note: - Memory ke block ko define karane ke liye %u ka use kiya jata hai.

Syntax of pointer:-

Data_Type P*variable_Name;
Example :-

Int *x;

Example:-
int a=20;

int *x;

x=&a; //holds address of a into x

Date – 3/11/2020

File Handling:-
If any user want to store any data as permanently into your computer.

Types of Files:-

• text file

• binary file

1 Binary file:- Data always remain into zero or one format.

2 Text file:- user data remain into text format.


• file is also a built-in data type.

Declaration:-

FILE *ptr;

printf()-----------fprintf()//output in file

scanf()-------------fscanf()//input in file

How we can create file in C:-

• open file => used fopen() method

Syntax:-

fopen (“File name &location”,”Mode”)


Example:-

fopen(“abc.txt”,”w”); //return file pointer

• insert data into file=>used fprintf() method

Syntax:-
fprintf(File pointer Name,”identifire”,VarName);

• close file => used fclose() method.

Syntax:-

fclose(Pointer VarName);

Example:-
fclose(ptr);

Types of mode in file handling:-

• w =>write or create file

• r=>read file

• w+ =>write and read both


• r+=>read and write both

• a=>append data into given file or add other content

Task -1
Online Test – C Programming

• Who is father of C programming

• Rasmus Lerdorf

• Dennice Ritchie

• James Gosling
• None

Answer : B

Date – 5/11/2020

Mode a:- append data in file.

Syntax:-

FILE *p;
P=fopen (“File name”,”a”);

Read mode(r):-

Syntax of fgets():-

char str[200];

fgets(StringName,sizeof(str),PointerVariableName)//return Boolean value

Task 1

User
-------------------------------------------------------------------------------------------------
------------------

• Entry 2 Withdraw 3 Display user entry details

Name Enter Account No: 4. Exit

Bank Name Amount:5000

Account Number

Amount
Program 1 //WAP in C by using file handling use write (w) mode

#include<stdio.h>

#include<conio.h>

#include<string.h>

void main()

{
char name[50];

char DOB[50];

char FName[50];

char MName[50];

char CName[50];

char Branch[100];
char PinCode[100];

char Addr[100];

FILE *fp;

clrscr();

fp=fopen("MyInfo.txt","w");
if(fp==NULL)

printf("Error,File not created");

}
else

printf("Enter your Name :");

gets(name);

printf("\nEnter Your Date of Birth :");

gets(DOB);
printf("\nEnter your Fathers Name :");

gets(FName);

printf("\nEnter your mother Name :");

gets(MName);

printf("\nEnter your college name :");

gets(CName);
printf("\nEnter your branch name :");

gets(Branch);

printf("\nEnter your PinCode number :");

gets(PinCode);

printf("\nEnter your address :");

gets(Addr);
clrscr();

printf("\n\n");

printf("*************Student Information************");

printf("\n\n");

printf("----------------------------------------------------------------");
printf("\n");

printf("Your Name :%s\n",name);

printf("Your Date of birth :%s\n",DOB);

printf("Your Father’s name :%s\n",FName);


printf("Your Mothres name :%s\n",MName);

printf("Your College Name :%s\n",CName);

printf("Your Branch :%s\n",Branch);

printf("Your Pin number :%s\n",PinCode);

printf("Your Address :%s\n\n",Addr);

//Stored in File
fprintf(fp,"*************Student Information************");

fprintf(fp,"\n\n");

fprintf(fp,"----------------------------------------------------------------");

fprintf(fp,"\n");

fprintf(fp,"Your Name :%s\n",name);

fprintf(fp,"Your Date of birth :%s\n\n",DOB);


fprintf(fp,"Your Fathers name :%s\n\n",FName);

fprintf(fp,"Your Mothres name :%s\n\n",MName);

fprintf(fp,"Your College Name :%s\n\n",CName);

fprintf(fp,"Your Branch :%s\n\n",Branch);

fprintf(fp,"Your Pin number :%s\n\n",PinCode);

fprintf(fp,"Your Address :%s\n\n",Addr);


fclose(fp);

printf("\nFile has been created successfully");

getch();
}

Program 2. WAP in C by using file handling use append (a) mode

#include<stdio.h>
#include<conio.h>

#include<string.h>

void main()

char name[50];

char DOB[50];
char FName[50];

char MName[50];

char CName[50];

char Branch[100];

char PinCode[100];

char Addr[100];
FILE *fp;

clrscr();

fp=fopen("MyInfo.txt","a");

if(fp==NULL)

printf("Error,File not created");


}

else

printf("Enter your Name :");

gets(name);
printf("\nEnter Your Date of Birth :");

gets(DOB);

printf("\nEnter your Fathers Name :");

gets(FName);
printf("\nEnter your mother Name :");

gets(MName);

printf("\nEnter your college name :");

gets(CName);

printf("\nEnter your branch name :");

gets(Branch);
printf("\nEnter your PinCode number :");

gets(PinCode);

printf("\nEnter your address :");

gets(Addr);

clrscr();

printf("\n\n");
printf("*************Student Information************");

printf("\n\n");

printf("----------------------------------------------------------------");

printf("\n");

printf("Your Name :%s\n",name);

printf("Your Date of birth :%s\n",DOB);


printf("Your Fathers name :%s\n",FName);

printf("Your Mothres name :%s\n",MName);

printf("Your College Name :%s\n",CName);

printf("Your Branch :%s\n",Branch);

printf("Your Pin number :%s\n",PinCode);


printf("Your Address :%s\n\n",Addr);

//Stored in File

fprintf(fp,"*************Student Information************");

fprintf(fp,"\n\n");
fprintf(fp,"----------------------------------------------------------------");

fprintf(fp,"\n");

fprintf(fp,"Your Name :%s\n",name);

fprintf(fp,"Your Date of birth :%s\n\n",DOB);

fprintf(fp,"Your Fathers name :%s\n\n",FName);

fprintf(fp,"Your Mothres name :%s\n\n",MName);


fprintf(fp,"Your College Name :%s\n\n",CName);

fprintf(fp,"Your Branch :%s\n\n",Branch);

fprintf(fp,"Your Pin number :%s\n\n",PinCode);

fprintf(fp,"Your Address :%s\n\n",Addr);

fclose(fp);

printf("\nFile has been created successfully");

getch();

Program 3. WAP in C to read data from file

#include<stdio.h>

#include<conio.h>
void main()

char str[1000];

FILE *fp;
clrscr();

fp=fopen("myinfo.txt","r");

if(fp==NULL)

printf("File has not been read");

}
else

printf("following data fetch from file\n");

while(fgets(str,sizeof(str),fp))

printf("%s",str);
}

getch();

Program 4. Display Intermediate MarKsheet


#include<stdio.h>

#include<conio.h>

void main()

char roll[10];
char name[30];

char FName[30];

char IDate[30];

int Hindi, English, Mathematics, Physics, Chemistry;


long total;

float percent;

FILE *fp;

clrscr();

fp=fopen("mark.txt","w");

if(fp==NULL)
{

printf("File has not been created");

else

printf("Enter Student Name :");


gets(name);

fprintf(fp,"student Name: %s\n",name);

printf("Enter Your rollNo:");

gets(roll);

fprintf(fp,"your rollNo: %d\n", roll);

printf("Enter Father name :");


gets(FName);

fprintf (fp,"Father Name: %s\n",FName);

printf("Enter Issue Date :");

gets(IDate);

fprintf(fp,"Issue Date %s\n",IDate);


fflush(stdin);

printf("Enter Obtain Marks of Hindi :");

scanf("%d",&Hindi);

fprintf(fp,"Hindi Marks :%d\n",Hindi);


printf("Enter Obtain Marks of English :");

scanf("%d",&English);

fprintf (fp,"English Marks: %d\n",English);

printf("Enter Obtain Marks of Mathematics :");

scanf("%d",&Mathematics);

fprintf (fp,"Mathematics Marks: %d\d”,&Mathematics);


printf("Enter Obtain Marks of Physics :");

scanf("%d",&Physics);

fprintf (fp,"Physics Marks: %d\n",Physics);

printf("Enter Obtain Marks of Chemistry :");

scanf ("%d", &Chemistry);

fprintf(fp,"Chemistry Marks: %d\n",Chemistry);


total= (Hindi+English+Mathematics+Physics+Chemistry);

percent=(total*100)/490;

clrscr();

printf("\n\n");

textcolor(BLUE);

textbackground(WHITE);
cprintf(" Intermediate Marsheet ");

printf("\n\n");

printf("Name - %s",name);

printf("\t\t\t\tRollNo - %s",roll);

printf("\n\n");
printf("Father Name :-%s",FName);

printf("\t\t\tIssue Date - %s",IDate);

printf("\n\n");

printf(" SrNo SubjectName MaxMark ObtainMarks");

printf("\n\n");

printf(" 1 Hindi 100 %d",Hindi);

printf("\n\n");

printf(" 2 English 90 %d",English);

printf("\n\n");
printf(" 3 Mathematics 100 %d",Mathematics);

printf("\n\n");

printf(" 4 Physics 100 %d",Physics);

printf("\n\n");

printf(" 5 Chemistry 100 %d",Chemistry);

printf("\n\n");
printf("-----------------------------------------------------------------------");

printf("\n");

printf("\t\tTotalMarks\t490\t\t%ld",total);

printf("\n\n");

printf("\t\tPercentage :%.2f Division ",percent);

if(percent>=60 && percent<=100)


{

printf("First");

else if(percent>=40 && percent<=60)

{
printf("Second");

else if(percent>=36 && percent<=40)

{
printf("Third");

else

printf("Fail");

//printf in file

fprintf(fp," Intermediate Marsheet ");

fprintf(fp,"\n\n");
fprintf(fp,"Name - %s",name);

fprintf(fp,"\t\t\t\tRollNo - %s",roll);

fprintf(fp,"\n\n");

fprintf(fp,"Father Name :-%s",FName);

fprintf(fp,"\t\t\tIssue Date - %s",IDate);

fprintf(fp,"\n\n");

fprintf(fp," SrNo SubjectName MaxMark ObtainMarks");

fprintf(fp,"\n\n");

fprintf(fp," 1 Hindi 100 %d",Hindi);

fprintf(fp,"\n\n");
fprintf(fp," 2 English 90 %d",English);

fprintf(fp,"\n\n");

fprintf(fp," 3 Mathematics 100 %d",Mathematics);

fprintf(fp,"\n\n");
fprintf(fp," 4 Physics 100 %d",Physics);

fprintf(fp,"\n\n");

fprintf(fp," 5 Chemistry 100 %d",Chemistry);

fprintf(fp,"\n\n");

fprintf(fp,"---------------------------------------------------------------------");

fprintf(fp,"\n");
fprintf(fp,"\t\tTotalMarks\t490\t\t%ld",total);

fprintf(fp,"\n\n");

fprintf(fp,"\t\tPercentage :%.2f Division ",percent);

if(percent>=60 && percent<=100)

fprintf(fp,"First");
}

else if(percent>=40 && percent<=60)

fprintf(fp,"Second");

else if(percent>=36 && percent<=40)


{

fprintf(fp,"Third");

else

{
fprintf(fp,"Fail");

fclose(fp);

printf("\n\n");
printf("File has been created successfully");

getch();

Program 5. Display Intermediate Marsheet


#include<stdio.h>

#include<conio.h>

void main()

char roll[10];

char name[30];
char FName[30];

char IDate[30];

int Hindi, English, Mathematics, Physics, Chemistry;

long total;

float percent;

clrscr();

printf("Enter Student Name :");

gets(name);

printf("Enter Your rollNo:");

gets(roll);
printf("Enter Father name :");

gets(FName);

printf("Enter Issue Date :");

gets(IDate);
fflush(stdin);

printf("Enter Obtain Marks of Hindi :");

scanf("%d",&Hindi);

printf("Enter Obtain Marks of English :");

scanf("%d",&English);

printf("Enter Obtain Marks of Mathematics :");


scanf("%d",&Mathematics);

printf("Enter Obtain Marks of Physics :");

scanf("%d",&Physics);

printf("Enter Obtain Marks of Chemistry :");

scanf("%d",&Chemistry);

total=(Hindi+English+Mathematics+Physics+Chemistry);
percent=(total*100)/490;

clrscr();

printf("\n\n");

textcolor(BLUE);

textbackground(WHITE);

cprintf(" Intermediate Marsheet ");


printf("\n\n");

printf("Name - %s",name);

printf("\t\t\t\tRollNo - %s",roll);

printf("\n\n");

printf("Father Name :-%s",FName);


printf("\t\t\tIssue Date - %s",IDate);

printf("\n\n");

printf(" SrNo SubjectName MaxMark ObtainMarks");


printf("\n\n");

printf(" 1 Hindi 100 %d",Hindi);

printf("\n\n");

printf(" 2 English 90 %d",English);

printf("\n\n");

printf(" 3 Mathematics 100 %d",Mathematics);


printf("\n\n");

printf(" 4 Physics 100 %d",Physics);

printf("\n\n");

printf(" 5 Chemistry 100 %d",Chemistry);

printf("\n\n");

printf("-----------------------------------------------------------------------");
printf("\n");

printf("\t\tTotalMarks\t490\t\t%ld",total);

printf("\n\n");

printf("\t\tPercentage :%.2f Division ",percent);

if(percent>=60 && percent<=100)

{
printf("First");

else if(percent>=40 && percent<=60)

printf("Second");
}

else if(percent>=36 && percent<=40)

printf("Third");
}

else

printf("Fail");

getch();

Program 6. Print table by using file handling

#include<stdio.h>

#include<conio.h>
void main()

int i,j,product;

FILE *fp;

clrscr();

fp=fopen("tabl.txt","w");
if(fp==NULL)

printf("Error");

else
{

for(i=2; i<=10; i++)

for(j=1;j<=10;j++)
{

product=i*j;

printf("%d\t",product);

fprintf(fp,"%d\t",product);

printf("\n");
fprintf(fp,"\n");

fclose(fp);

printf("File has been created successfully");

getch();
}

Program 7. WAP in C to create insert data into file as permanently.

#include<stdio.h>

#include<conio.h>

void main()
{

FILE *ptr;

char msg[20];

clrscr();

ptr=fopen("myf1.txt","w");
if(ptr==NULL)

printf("File is not created");


}

else

printf("Enter your message:");

gets(msg);

fprintf(ptr,"%s",msg);
fclose(ptr);

printf("Thanks ! Now your file is created");

}getch();

Program 8. WAP in C to create insert data into file as permantly

#include<stdio.h>
#include<conio.h>

void main()

FILE *ptr;

char msg[20];

clrscr();
ptr=fopen("myf1.pdf","w");

if(ptr==NULL)

printf("File is not created");


}

else

printf("Enter your message:");


gets(msg);

fprintf(ptr,"%s",msg);

fclose(ptr);

printf("Thanks ! Now your file is created");

getch();
}

Program 9. //WAP in C to create insert data into file as permantly

#include<stdio.h>

#include<conio.h>

void main()
{

FILE *ptr;

char msg[20];

clrscr();

ptr=fopen("myppt.ppt","w");

if(ptr==NULL)

printf("File is not created");

else
{

printf("Enter your message:");

gets(msg);

fprintf(ptr,"%s",msg);
fclose(ptr);

printf("Thanks ! Now your file is created");

getch();

Program 10. //Develop a console Application of online test in C

#include<stdio.h>

#include<conio.h>

void main()

int r=0,w=0;
char opt1,opt2,opt3;

char name[40];

FILE *ptr;

clrscr();

ptr=fopen("Ctest.txt","w");

if(ptr==NULL)
{

printf("File is not created");

else

{
printf("\n\n\n");

textcolor(RED);

cprintf(" Online Test - C Programming" );

printf("\nEnter your name :");

gets(name);

clrscr();

textcolor(WHITE);

printf("\n\n\nQ.No- 1. Who is father of C programming ?");

printf("\nA) Rasmus Lerdorf");


printf("\nB) Dennice Ritchie");

printf("\nC) James Gosling");

printf("\nD) None");

printf("\nEnter your option :");

scanf("%c",&opt1);

fflush(stdin);
if(opt1=='B' || opt1=='b')

r++;

else

{
w++;

printf("\n");

printf("\n\n\nQ.No- 2. What is array ?");

printf("\nA) List");
printf("\nB) Collection");

printf("\nC) User Define datatype");

printf("\nD) Both B & C");

printf("\nEnter your option :");


scanf("%c",&opt2);

fflush(stdin);

if(opt2=='B' || opt2=='b')

r++;

}
else

w++;

printf("\n");

printf("\n\n\nQ.No- 3. What is variable ?");

printf("\nA) Value storage");

printf("\nB) Data Type");

printf("\nC) UDF");

printf("\nD) None");
printf("\nEnter your option :");

scanf("%c",&opt3);

fflush(stdin);

if(opt3=='A' || opt3=='a')

{
r++;

else

{
w++;

printf("Right Answer :%d\n",r);

printf("Wrong Answer :%d\n",w);

fprintf (ptr,"User name: %s\n", name);

fprintf(ptr,"Right Answer :%d\n",r);


fprintf(ptr,"Wrong Answer :%d",w);

fclose(ptr);

printf("File has been created successfully");

getch();

Program 11. online Quiz

#include<stdio.h>

#include<conio.h>

void main()

{
int opt1,opt2,opt3,w=0,r=0,score=0;

char name[40];

FILE *fp;

clrscr();

fp=fopen("HTML.txt","w");
textcolor(BLUE);

textbackground(WHITE);

printf("\n\n");

if(fp==NULL)
{

printf("File has been not created ");

else

cprintf( " ONLINE HTML QUIZ " );


printf("\n");

printf("Enter your name :");

gets(name);

printf("\n\n");

printf("\nQ.No 1. What is full form of HTML ?");


printf("\n1.Hyper Text Markup Language \t 2.Hyper Text Makup Language\t
3.None ");

printf("\nChoose your option :");

scanf("%d",&opt1);

if(opt1==1)
{

r++;

score++;

else

{
w++;
}

printf("\n\nQ.No 2. What is full form of CSS ?");

printf("\n1.Class Secondry School \t 2.Cascading Style Sheet\t 3.None ");

printf("\nChoose your option :");


scanf("%d",&opt2);

if(opt2==2)

r++;

score++;

}
else

w++;

printf("\n\nQ.No 3. What is full form of XML ?");

printf("\n1.Exta Markup Language \t 2.Extensible Markup Language\t 3.None ");


printf("\nChoose your option :");

scanf("%d",&opt3);

if(opt3==2)

r++;

score++;
}

else

w++;

}
printf("\nRight Answer:%d\n",r);

printf("Wrong Answer:%d\n",w);

printf("Score:%d",score);

fprintf(fp,"User name :%s\n",name);


fprintf(fp,"Right Answer :%d\n",r);

fprintf(fp,"Wrong Answer :%d\n",w);

fprintf(fp,"Your Score :%d",score);

fclose(fp);

printf("\nFile has been created successfully");

getch();

--------------HTML NOTES------------
HTML:-Hyper Text Markup language.

Html is used to create web page and web application.

We can create a static website.

It is developed by Tim Berners Lee .


HTML 1993
HTML2 NOVEMBER 1995
HTML3 JANUARY 1997
HTML4 DECEMBER 1997
HT ML5 OCTOBER 2014
TAG:--

Used to create html program and render properties.

Every tag in html perform different task.

Types of tag:----

1.Self closing tag.

2.Closing tag or Container tag.

Self closing tag:--

<…………/>

<img/>,<tagname/>

Ex:-<link/>,<br/>,<hr/>,<base/>……etc.

Syntax:--

<……./>…<…./>

Text tag:--

1.<heading>:==

<h1>………….</h1>

<h6>.........</h6>

<span>………..</span>

<i>………….</i>

<u>……………</u>

<label>…………</label>

<br>
<pre>…….</pre>

<marquee>………..</marquee>

<p>…………</p>

<title>………….</title>

Marquee attribute properties:---

1.Direction=”…….”

2.Scrollamount=”…….”

3.Behaviour=”alternate”

4.ommouseover=”stop()”

5.onmouseout=”start()”

6.height=”……..”

7.widht=”…”

Image tag:--

<img src=”…” height=”….” Width=”….”>

text-transform : uppercase;

text-transform : lowercase;

text-transform : capitalize;

column-span:all;

text-indent:..px;

overflow:hidden;

resize:both;
text-align:justify;

Type of List:----

1.Order list (Number list) <ol>……..</ol>

2.Unorderd list <ul>……..</ul>

3.Description list (Definatyion list) <dl>……</dl>

4.Nested list:-

1.Order List:-----

Syntax of order list:--

<ol>

<li>….</li>

<li>.....</li>

</ol>

Type=”….”

Type=”A”

Type=”1”

Start=”…”

2.Unorder List:--

Syntax:--

<ul>

<li>……</li>

……………..
………….

<li>…………</li>

</ul>

Type=”circle”

Type=”square”

3.Description list.:--

Syntax:--

<dl>

<dt>….</dt>

<dd>….<dd>

</dl>

4.Nested list:--

Syntax:--

<ol>

<li>

<ol>…</ol>

</li>

<li>……</li>

</ol>

Table tag:-

<table>
<tr>

<th>…</th>

</tr>

<tr>

<td>..<td>

..

<td>..</td>

</tr>

</table>

Table attribute property:-

1.border=”….” Use of table border

2.bgcolor=”…” table background color change

3.background=”….” Use of table background image

4.colspan=”…” merg of columns

5.rowspan=”..” merg of rows

6.cellspacing=”….” Use of cell space

7.cellpadding=”..” use of text padding

Anchor tag:--

<a href=”…………” target="_blank">….</a>

For tag:--

<input />
<button>…..</button>

<label>….</label>

<span>….</span>

<textarea>……</textarea>

<option>…..</option>

<select>….</select>

<option />

Button type:--

1.Submit button

2.Reset Button

3.Dummy button

1.<input type=”submit” value=”Record Save”/>

2.<button type=”submit”>Record Save</button>

3. <input type=”reset” value=”Record Clear”/>

4. <button type=”reset”>Record Clear</button>

5. <input type=”button” value=”Dummy button”/>

6. <button type=”button”>Dummy</button>

Input controls:--
1.Input text <input type=”text”> string value

2.Input number <input type=”number”>Enter the value number

3.Input Email <input type=”email”>

4.Input Password <input type=”password”>

5.Input Date <input type=”date”>

6.Input option <input type=”radio”>

7.Select Month <input type=”month”>

8.Select Week <input type=”week”>

9.Select file <input type=”file”>

10.<textarea>..</textarea>

11.<input type="hidden">

12.<input type="average">

Drop down:-

<select>

<option>..</option>

<optin>…</optin>

</select>

Form Attribute Property:--

1.Placeholder=”…” use of text shadow

2.maxlength=”..” use of maximum length


3.required=”..” use of validation

4.name=”..” calling of server

5.value=”..” use of static code

6.action=”..” calling of dynamic page

7.method=”..”

8.enctype="multipart/form_data" use os save file

9.rows="...." merg of rows

10.cols="....." merg of cols

============HTML5 TAGS =================

1.<header>….</header>

2.<section>….</section>

3.<footer>…</footer>

4.<iframe>…</iframe>

5.<frameset>…..</frameset>

6.<details>

<summary>....</summary>

<p>.....</p>

</details>

7.<summary>….</summary>

8.<video controls>

<source src="vdoname.mp4" type="video/mp4"></source>


</video>

9.<audio controls type="">

<source>.....</source>

</audio>

10.<datalist>……</datalist>

That is a dropdown list tag.

<datalist>

<option value=".....">

<option value="....">

</datalist>

11.<sup>..</sup>

12.<sub>….</sub>

13.<option />

14.<colgoup>…</colgroup>

15.<col />

16.<source>…..</source>

17.<fieldset>

<legend>....</legend>

</fielset>

18.<legend>…</legend>

19.<main>....</main>
--------------CSS NOTES------------
It is developed by Hecan viumly.

CSS stand for Cascading style sheet.

CSS is used to design HTML tags.

You can add new looks to your old HTML program.

Type of CSS:==

==========

1.INLINE CSS

2.INTERNAL CSS

3.EXTERNAL CSS

=================

1.INLINE CSS:-

=============

Inline css is the write code in same line with help of style attribute property
html tag.

Example:==

<div style=”….;…;….;…;…”></div>

Text CSS Property:==

1.color:…….;

2.text-align:…..;

3.font-size:….;
4.font-family:….;

=======================================

Background property:-

======================================

1.Background:….;

2.Background-color:….;

3.Background-image:url(‘……..’);

4.Background-attachment:fixed;

5.Background-repeat:no-repeat;

6.Background-size:cover;

7.height:…..;

8.width:….;

9.background:linear-gradient(…,…,…,..,);

Margin Property:=====

1.margin-left:…;

2.margin-right:….;

3.margin-top:…..;

4.margin-bottom:…..;

Padding Property:=====

1.padding-left:…;

2.padding-right:….;
3.padding-top:…;

4.padding-bottom:…;

5.padding:….;

1.Selector:====

Selector which are identify any tag of html some symbole used in selector.

Like as #,*,.;

Type of selector:--

1.id selector.(#)

2.class selector.(.)

3.Element selector.

4.Group selector.

5.Universal selector.

Syntax of id selector:--

#selectorName

..write css code

Ex:--

<html>

<head>

<style>
……

</style>

</head>

<body>

<div id=”……”></div>

</body>

</html>

2.Syntax of class selector:--

.selectorname

…..write css code

Ex:--

<html>

<head>

<style>

.outer

……..

</style>

</head>

<body>
<div class=”……”></div>

</body>

</html>

3.Element selector:--

Tagname

….

Ex:==

<html>

<head>

<style>

….write css code

……..

</style>

</head>

<body>

<p>Welcom to Lucknow</p>
</body>

</html>

Group Selector:===

Tagname,tagname,tagname

……write css code

Universal Selector:==

*{

……write css code

Internal css:==

Internal css is the write code in same html page with the help of style tag in
head section block.

Ex:==

<html>

<head>

<style>

..write css code

</style>
</head>

<body>

..apply css section

</body>

</html>

Background Radius Property:--

1.border-radius:….;

2.border-radius:…,…,…,….,…;

3.border-radius:50px;

4.border-radius:50%;

5.border-radius:50cm;

6.border-radius:10px 10px 10px 10px;

=======================================

Boredr tag=

===========

border-left="3px dotted red"

border-left="3px dashed red"

border-left="3px ridge red"

border="3px dotted red"

END CSS & HTML

=======Bootstrap===========
=>Bootstrap is the popular html, css and javascript framework for
developing a responsive and mobile friendly website.

Bootstrap is collection of classes.

Developed by Mark Otto and Jacob tornton in year 2010 name of twitter
Blueprint.

Rename in 2011 Bootstrap.

Bootstrap is a basic layout class.

1.class="container"

2.class="container-fluid"

Row :--

Rows devided into 12 colums.Use for device.

1.class="col-xl-12" Extra large device

2.class="col-lg-12" Large device

3.class="col-md-12" Medium Device

4.class="col-sm-12" Small device

Ex:---

<html>

<head>

<link href="link of css file" rel="stylesheet">

<script src="link for js file"></script>

</head>

<body>
<div class="container-fluid">

<div class="row">

<div class="col-md-12">

<div class="col-md-4"></div>

<div class="col-md-4"></div>

<div class="col-md-4"></div>

</div>

</div>

</div>

</body>

</html>

=================================

-----------JAVA NOTES------------
JAVA:-
Java is Object Oriented Programming Language.

Java is a general purpose Object Oriented Programming


Language.

Java is platform Independent Language.

Java is portable language.


Java is secure programming language.
Java is Devolop by JAMES GOSLING in year 1995.

Features of java:-
There are some features of java.

1. Simple

2. Object Oriented
3. Portable

4. Compile Both

5. Secure......etc.

How we can install java and what Software for


core java..
Any Editor:- Notepad,Notepad++...
Programming:-

1. JDK 7,8...

A. For 32bit OS.

B. For 64 bit OS....etc

Software Requirment:-
1. JDK:-jdk stand for Java Devolopment Kit. It is the
collection of Multiple software like as----
JIT,JRE,GC,JVM....etc.
Compilation Scanario of Java:-

Source code Compiler Bytecode Machine code

.java ===>JIT (.class) || JRE INTEL

GC <>||
JVM IBM

1. JIT:- jit stand for just-in-time.It is used to compile of


source code into byte code(class file).

We can say JIT is a internal compiler.


2. JVM:- jvm stand for java virtual machine. It is used to
convert byte code(class file) into machine code(00011011).

3. JRE:- jre stand for java run time enviornment. It provide


the running environment of the jvm.

4. GC:- Gc stand for Garbage collection. If you declare


Multiple variable into a program and some of them is not
used into the program then at run time GC Remove the
space of varriable memory.

Class:- Class is a keyword it is use to declare class in java..

public static Void Main

Public is a keyword.
public is access_modifier that is used to global declaration
of any member of method.

Static is a keyword,if we declare any method as static


method.

It is always call direct with the name.


Void is a empty data type means it dont return any type of
value.

Main is a method that is represent the starting point of the


program.

How we can create a java program:- Ther are some step are
used.

1. Documentation Block(comment line)//option block

2. Package Section
3. Class Section

4. Main Section

{
5. I--->input,P-->process,O-->outpu.

6. UDF(user define function) //optional block


}
Ex:-

//wap in java to print hii package block

class demo

{
public static void main(String[] agrs)

.//code bolck

}
User define function block

1. Package:- package is the collection of classes,classes is


the collection of data member (variable)and data
method(function).

Package is a same like as header file in C program.

If you want to use any built-in package the we used import


keyword.

Note:-
If you want to create a package then we used package
keyword or built-in package import.

Note:-

Every built-in package is avilable into java folder.

Syntax of package:-
importjava.io.*;

import--->keyword

java--->main package of directory

io--->package name
*--->is indicate that you want to access all classes from io
package.

after java.-->Access opereator

Input/Output function in java:-


Output function in java:-

1. print():-it print only statement and curson remain same


line.

2. println():-println statement and send curson to new line.


3. printf():-it is used for formatting.

Input function in java:- There are two input function.


1. Scanner Class
2. BufferReader Class

1. Scanner:- Scanner is a class that is avilable into util


package.

it have following method for input.


A. .nextline().

B. .nextint().

C. .nextfloat()......etc.

1. .nextline():- it is a input method and avilable into scanner


class.

neextline()method always return value string type.

2. .nextint():- it is also a input function. it is also a avilable


into scanner class.

nextint()return the value int

Syntax:

sc.varname=sc.nextint();

Syntax of Scanner class:-


Classname objectname=new Classname();

Ex:-
Scanner sc=new Scanner(system.in);
How to run program in command prompt.

1. javac programname.java

2. classname.java

Array:-
Syntax:-

Data_Type[]Varname=new Data_type[Size]

Ex:-

int[]list=new int[10];
OOPS:——(object oriented programming system).

It is not a programming language, it is concept .

It is a metrology or paradigm of programming language.


Ex:-
c++,java,c#,php, python…etc

We know that object is also a real world entity.

Object have two status and behaviour.

Ex:-
Mobile,laptop,watch …etc
Features of OOPS:—
I. class

II. object

III. inheritance

IV. polymorphism
V. Encapsulation

VI. Data abstraction

Inheritance:—

• single level inheritance


• multi-level inheritance

• multi -inheritence

Polymorphism:-
▪ compile time polymorphism
Method

▪ Run time polymorphism

Class:——it is keyword as well as container

Class is user define data type


It is collection of data member (variable and property)and
data method (function).

-------------------------------------------------------

Inheritance:- Inheritance is the features of object oriented


programming language.

=> We can make a one class by using execting class the


class is known as Base/Maint/Parent/Superclass and new
class is the derived class/sub- child class.

Note:-
When we inherit one class into class we used Extends
Keyword.

Type of Inheritance:- There are three type of inheritance.

1. Single level inheritance


2.Multi livel inheritance

1. Multiple inheritance:-

1. Single level inheritance:- In a single level inheritance one


a parent and second a child class.

2. Multi-Level inheritance:- In a multi-level inheritance one


class inherit another class and another class inherit to
privious class So the process remain continue......

Syntax:-
class A
{

class B extends A

{
}

class C extends B

}
Data Abstraction:- Data abstraction is known as data hiding
or acces specifier.

=> for data hiding it provide three keyword.

1. public
2. protect

3.private

Public:- public is a keyword That is used for define any data


member or data method public.

Ex:- int a;
Protected:- protected is also a keyword it define data
members or data method can called only child class.

Ex:- protected int a;

Private:- private is a also keyword if you declare private data


member and data method then we write as:

Syntax:- private int a;

Note:-By default all data members and data method remain


as private

Polymorphism:- We know that poly means "many" and


morphism means "forms"

=> One things multiple for is called polymorphism.

Ex:- Water,shape,human...etc

Type of polymorphism:- There are two type of


polymorphism.

1. Compile Time Polymorphism

2. Run Time Polymorphism

1. Compile Time Polymorphism(method overloading):-


=> into this process method name remain same but
perameter changed.

Ex:- sum(),sum(inta,intb),sum(inta,intb,intc)
sum(inta,intb,intc);
2. Run Time Polymorphism(method overriding):-

=> into this concept method and perameter both are same
,the value of parent class...

=> method overide by child class.


Difference between overloading and method overriding.

Method overloading:--- Method overriding

====================================

1. same class | 1. same name


2. same class |2. different class

3. different arguments | 3. same argument

4. no of arguments | 4. no of arguments

5. sequence of arg | 5. sequence of arg


6. type of arg | 6. type of arg

Note:-

JSP support null value

Servelet is a class of java that is compiled class .


=> It has 4 built-in function.
1. processrequest(): If you want to write html inside od this
class then we used this method.

2. doget(): If you want to call any other method on load


event od web page then we write code inside of this
method.

3. dopost(): If you want to work on post of any web page


then we write code inside of this method.

4. serveletInfo(): If have all information related to servelet


like as help for user.

JDBC:- (sql package) It established

1. Connection

2. DriverManager

3. PreparedStatement
4. ResultSet

Database

=================================

------------Database-------------------
Database:-Data is raw fact material,when any user input any things that remain into
raw form.

Information:-The process of data is called the information.


Process:---

Data Hello=========>Hello information

Database:- Database is the collection of data+information.is called Database.

SQL:- SQL stands for Structure Query language it is not a programming language
But it is a database programming language.

SQL:- There are some type of sql.

1. DML(Data Manipulation Language)

insert,update,delete

2. DDL(Data Definition Language)

create,alter,truncate,drop

3. DQL(Data Query Language) Select

4. TCL(Transaction Control Language)

==========1.Create:=========

Create command is used to create the database object.

Syntax:- create Database DatabaseName

EX:- create Database MYDB;

//how we can create table(Syntax)?

create Table TableName

Col1 datatype(size),

Col2 datatype(size),

Col3 datatype(size);
)

Ex:-

create table contact

name varchar(30),

mob varchar(16),

email varchar(100),

msg varchar(200);

=================2.Insert:===================

Insert command is used to insert the data into database table. Syntax:-

insert into Table_name values(value1,value2,value3......valueN)

Ex:-insert into contact values('ram','9026750164',[email protected],hello);

==================3.Select(Read):============

Select command is used to show (display)data from database table.

Syntax:-

1.//show all data

Syntax:- select*from TableName

Ex:-select*from contact;

2.//display data specific column name

Syntax:- select col1,col2,col3....from TableName

Ex:-select name,msg,from contact;


3.//display data behalf of Id with where clause ?

Syntax:-select*from TableName where id=value;

Ex:-slect*from contact where uid=103;

===================4.Update:==============

Update command is used to update the record into database table.

Syntax:- update Table_name set col1=value,col2=value,col3=value....where


Id=value;

Ex:- update contact mob=9026750164 where uid=103;

===============5.Alter:===============

Alter command is used to modify the structure of database table.

Syntax:- alter table Table_name Add columnname datatype(size); Ex:-alter


table contact Add City varchar(100);

===================6.Delete:================

Delete command is used to delete the record into database table in row wise.

Syntax:- delete from Table_name where ID=value;

Ex:-delete from contact where uid=101;

=====================7.Truncate:===============

Truncate command is used to delete whole data from database table.


Syntax:- truncate table Table_name;

Ex:- truncate table contact;

================8.Drop:====================

Drop command is used to delete the database and table name.

Syntax:-drop database databaseName;


Ex:- drop database MYDB;

---------------Auto encrement :----------

=>Identity (SEED,Identity(def)):(1,1)

=>Auto encrement Values on a column.

=>SEED:- Starting value of ID.

=>Incremenrt[Def]:--Encrement value bitween seed.

=>Data type is (int,decimal,float).

NOTE:-A table contains one indentity(Function only)

Question :-----How can set operator is used in multiple statement in database ?

Set Opreator:-=> To combine two or more than two select statement , that process is
called operator.

There are some type of set operator.

1.Union

2.Union All

3.Entersect

4.Except

=============1.UNION=============

=>To combine two or more than two select statement as a single unit without dublicate
value.Common value only one time execute.

===========2.UNIONAll==========

=>Two combine two or more than two select statement as a single unit with duplicate
value.

=========3.INTERSECT-:===========

=> the return the comman value from the table.


==========4.EXCEPT:=============

=>To return the all value from the left hand side table which are not found in the right
hand table.

===============Rules============

1.Number of column should be same within select statement .

2.Order of column should be same.

3.Data_type of the column must be match.

==========Clause===========

Clause:- 1.Group by clause 2.Having Clause

1.Group By Clause:-It is used to grouping the similear data based on the column..

2.Having Clause:-----

->To filitring the records After grouping the data having clause can be used with group
by clause.

=============JOIN:===========

1.There are three retrive method in join opration.

JOIN OPRATION:--

1.Selection----------->With where keyword.

2.Projuction---------->With on keyword.

3.Join:- When we retrive the data from more than One table,That process is called join.

There two type of join:-

1.ANSI Formate Join

2.NON-ANSI Formate Join

1.ANSI Formate:- With "ON" keyword join Condition,that process is called ANSI formate
join. It's also called New Style Formate Join.
There are some type of a ANSI formate join.

1.Inner Join

2.Outer Join

There are three type of outer join.

a).Left outer join

b).Right outer join

c).Full outer join

3.Cross Join

4.Natural Join

5.Self Join

===============1.INNER JOIN=========

When we retrive the data from multiple table based on equality coundition, That process
is called inner join.

NOTE:-If we use inner join then we use some rules.

1.One column is nessarary .

2.The common column column data_type must be same.

3.Matching data/rows.

= ==============2.OUTER JOIN:-==============

Outer join is used to matching and unmatcing data from the table.

1.left outer join

2.right outer join

3.full outer join

1.LEFT OUTER JOIN:----- Left outer join show the data matching and unmatching data
BUT Left side All data show and Right side only matching data show.
2.RIGHT OUTER JOIN :------- Right outer join show the data matching and unmatching
BUT Right side all data show and Left side only matching data show.

3.FULL OUTER JOIN:------Full outer join show the data matching and unmatchiong data
BUT Left side All data show and Right side All data show.

3.CROSS JOIN:-----The product of row (M*N rows).There is no required,A Common


column in the table.

4.NATURAL JOIN:- It's not support SQL,It's the concept we can use Oracal.

5.SELF JOIN :----- Joining a table data by itself, that process is called self join.

Can use with Alias name of the table.

Any number of Alias name on a single table.

Self join can be implement in a single table.

-----------------------------------------------------------------------

---Date 30/11/2023----
---Topic Non-ANSI Formate join=-----
---step 1 create database ------
CREATE DATABASE EQUI
use EQUI
---step2 create table -----
CREATE TABLE Emp
(
Eid int,
Ename varchar(200),
Esalary money
);
CREATE TABLE Emp1
(
Eemail varchar(100),
cname varchar(100),
Eid int
)
insert into Emp values (101,'Ram',2000)
insert into Emp values (102,'Shyaam',3000)
insert into Emp values (103,'Sita',4000).
select * from Emp
select * from Emp1
insert into Emp1 values
('[email protected]','Mecatredz',101)
insert into Emp1 values
('[email protected]','Technology',102)
insert into Emp1 values
('[email protected]','Pvt',103)
----use of equi join matching data show ----
select* FROM Emp,Emp1 WHERE Emp.Eid = Emp1.Eid;
SELECT * FROM Emp,Emp1 WHERE Emp.Eid<Emp1.Eid
--------------------------------------------------------------------

---Date 28/11/2023---
-----Topic Join------
---Step1 create database---
CREATE DATABASE MTJOIN
use MTJOIN
---step2 create table ---
CREATE TABLE Student
(
sid int,
sname varchar(200),
semail varchar(100),
courseId int
)
---step3 use of select command ----
SELECT * FROM Student
SELECT * FROM Course
---step4 create a new table ----
CREATE TABLE Course
(
courseId int,
Cname varchar(200),
Cfees decimal
)
---step5 use insert command in table course-----
INSERT INTO Course VALUES(10,'MTech',2000)
INSERT INTO Course VALUES(20,'BTech',1000)
INSERT INTO Course VALUES(40,'DIPLOMA',7000)
INSERT INTO Course VALUES(50,'BCA',6000)
---step6 use of inner join------------
SELECT * FROM Student inner join Course ON
courseId=courseId ---error because server has
confused not find table name---
SELECT * FROM Student inner join Course ON
Student.courseId=Course.courseId---true condition--
-
--use of left outer join--
SELECT * FROM Student left outer join Course ON
Student.courseId=Course.courseId
SELECT * FROM Student s left outer join Course c ON
s.courseId=c.courseId
---use of right outer join ---
SELECT * FROM Student right outer join Course ON
Student.courseId=Course.courseId
--use of full outer join----
SELECT * FROM Student s full outer join Course c ON
s.courseId=c.courseId
--use of cross join--
SELECT * FROM Student cross join Course
--------New Topic Self join---------------
---step1 create database ----
CREATE DATABASE SelfJoin
--step2 create table -----
CREATE TABLE Emp1
(
Eid int,
ename varchar(200),
salary money,
email varchar(90),
mob varchar(20)
)
---INSERT COMMAND ----
INSERT INTO Emp1 VALUES
(201,'Amit',2000,'[email protected]',8898282728)
INSERT INTO Emp1 VALUES
(202,'Amrita',3000,'[email protected]',8151282728)
INSERT INTO Emp1 VALUES
(203,'Sandeep',4000,'[email protected]',8898234567)
INSERT INTO Emp1 VALUES
(204,'Sumit',5000,'[email protected]',7454746474)
INSERT INTO Emp1 VALUES
(205,'Diksh',6000,'[email protected]',164983219)
--select table---
SELECT*FROM Emp1
--use of self join-----
SELECT * FROM Emp1 where salary =salary----same
result but we want to merg two table then we need
Alias---
SELECT * FROM Emp1 e1,Emp1 e2 WHERE e1.Eid=e2.Eid
SELECT * FROM Emp1 self join Emp1 ON
Emp1.Eid=Emp1.Eid
-------------------------------------------------------------------

------------------------SUB BLOCK --------------------

1.Named Block

2.Written code in Sub block in save Database. That code can be use
(.net/java/DBApplication...).

Type of sub block:-----There are two type of Sub block .

1.Stored Function

2.Store Procedeure

Store Function :-----

1.A function must have a name and function can never start with special charectre.

Ex:----@,$,#,%....etc.

Function work with select statement.

Function can be used in SQL like as

1. SUM()

2.AVG()

3.MIN()

4.COUNT()

5.DATETIME()

6.GETDATE()...etc.
Function compile every time.In a procedure function only work with input parameter.

Try and Catch block is not use in procedure.

Type of function:------

1.Bulit-in function(System define function)

2.Use define function(UDF)

=================Store Procedure==============

* Working with store procedure:---There are pre compiled (on compilation )block. It's
provide security in our project. We can create a store procedure in Two ways.

1.Without parameter 2.With Parameter

//Store procedure is create this syntax:----

create procedure procedure_name

As

begin

<body of code>

End

//How we can call a store procedure:----

Syntax:--

exec/execute procedure_name/p ;

//Parameter of store procedure:----

1.Input parameter():- It's used in IN keywords.

2.Out parameter():- Return the value from Store procedure in OUT keywords.

//How we can declear variables in store procedure:----

create procedure procedure_name

(
@variable_name data_type(size),

@variable_name data_type(size),

..................................

AS

BEGIN

//code here

END

----------------------------------------------------------------------

-------------DATE 30-11-2023---TOPIC STORE


PROCEDURE IN CRUD--------------
-------STEP1 CREATE DATABASE -------------
CREATE DATABASE STOREPROCEDURE
--STEP2 CREATE TABLE ----
CREATE TABLE EMP
(
EmpId int PRIMARY KEY IDENTITY (1,1),
Ename varchar(70),
EDesigination varchar(100),
);
----USE DATABASE COMMAND-------
USE STOREPROCEDURE
------USE SELECT COMMAND-------
SELECT*FROM EMP
-----------USE INSERT COMMAND-------------
INSERT INTO EMP VALUES ('ER.ABHIJEET
SHUKLA','SOFTWARE DEVELOPER')
INSERT INTO EMP VALUES ('ER.SURAJ SINGH','CEO')
INSERT INTO EMP VALUES ('ER.SANDEEP KUMAR','CTO')
INSERT INTO EMP VALUES ('ER.AKHILESH
KUMAR','DIRECTOR')
------------STEP5 CREATE A PROCEDURE NAME
INSERTRECORD---------------
CREATE PROCEDURE INSERTRECORD
(
@emp_name varchar(100),
@emp_Desigination varchar(100)
)
AS
BEGIN
INSERT INTO EMP VALUES(@emp_name,@emp_Desigination)
END

--USED INSERT ONE DATA ANY USING PROCEDURE----


exec INSERTRECORD 'Abhijeet','Software Engi..'
------USE ALTER WITH STORE PROCEDURE CHANGE DATA
TYPE-----
ALTER PROCEDURE INSERTRECORD
(
@Ename nvarchar(200),
@EDesigination nvarchar(200)
)
AS
BEGIN
INSERT INTO EMP VALUES(@Ename,@EDesigination)
END
-------STEP7 CREATE A NEW PROCEDURE NAME UPDATE
RECORD----------
CREATE PROCEDURE UPDATERECORD
(
@id int,
@Ename varchar(200),
@EDesigination varchar(200)
)
AS
BEGIN
UPDATE EMP SET
Ename=@Ename,EDesigination=@EDesigination WHERE
EmpId=@id
END
------USE OF UPDATE COMMAND USING PROCEDURE -------
---------
exec UPDATERECORD 6,'Abhijeet','Director'
----------CREATE DELETE PROCEDURE-----------------
CREATE PROCEDURE DELETERECORD
(
@EId int
)
AS
BEGIN
DELETE FROM EMP WHERE EmpId=@EId
END
------USE DELETE RECORD--------------
exec DELETERECORD 5
----------------------------------------------------------------------

--------------TCL[Transection Control Language]------------

To perform some opratoion.

>Insert

>update

>Delete

To control the data of the table purpose.

Some methods of used.


1.BEGIN Transaction

2.Commit :-- ROLLBack,SavePoint.

1.BEGIN:---- To start the Transaction.

Sy:- BEGIN Transcation

<write statement>

2.Commit:----- To make the transaction Permanent By user.

NOTE:---ONCE THE OPRATION IS COMMITED THEN WE CAN NOT ROLLBACK.

Sy:---BEGIN TRANSACTION

<write statement>

commit

2.1.ROLLBACK:----- To cancle a transaction then we can rollback.

Sy:- BEGIN TRANSACTION

ROLLBACK

2.2.SAVE POINT:------It's used to create temp memory for store the data values which we
want to conditionally cancelled.

Sy:-

Begin Transaction

<.....>

save transaction pointername

<...........>

---------------------------------------------------------

-----DATE-01-12-2023----TOPIC ALL CRUD IN ONE


PROCEDURE------
-----STEP1 CREATE A DATABASE ----
CREATE DATABASE ALLCRUD
use ALLCRUD
--step2 create a table ----
CREATE TABLE employee
(
Id int primary key,
ename varchar(90),
location varchar(100),
Department varchar(100),
Age varchar(60)
)
---STEP3 SELECT COMMAND--------
SELECT * FROM employee
----STEP4 INSERT SOME DATA-----
INSERT INTO employee
VALUES(101,'ABHI','LKO','CSE',20)
INSERT INTO employee
VALUES(102,'ABHIJEET','BBK','EC',30)
INSERT INTO employee
VALUES(103,'ABHINAV','GKP','IT',40)
INSERT INTO employee
VALUES(104,'ABHIMANU','DELHI','ELX',50)
INSERT INTO employee
VALUES(105,'ABHISHEK','MUMBAI','ME',60)
-----STEP5 CREATE A ONE PROCEDURE NAME CRUD -------
CREATE PROCEDURE CRUD
(
@Id int,
@ename varchar(90),
@location varchar(100),
@Department varchar(100),
@Age int,
@choice varchar(100)
)
AS
BEGIN
/*use insert statement for store procedure */
if @choice='insert'
begin
insert into employee
(Id,ename,location,Department,Age) values
(@Id,@ename,@location,@Department,@Age)
end
/*use update statement for for store procedure*/
if @choice='update'
begin
update employee set ename=@ename,location=@location
where Id=@Id
end
/*use delete statement for store procedure*/
if @choice='delete'
begin
delete from employee where Id=@Id
end
END

----use INSERT,UPDATE,DELETE-----
exec CRUD
@id=6,@ename=SURAJ,@location='HYD',@Department='JE'
,@Age='60',@choice='insert'
exec CRUD @id=103,
@ename='ABHINAV',@location='JHASHI',@Department='II
T',@Age='40',@choice='update'
exec CRUD
@id=6,@ename='edehbj',@location='ghhds',@Department
='gfgdhvh',@Age='75',@choice='delete'
---------------------------------------------------------

================= ORACLE=====================
DBMS:----DBMS stand for db management system.

It's used to manage the multiple DB.

It's also known as Application.


Ex:- MYSQL,SQL,ORACLER,SQLITE....etc.

PL/SQL:-------PL/SQL stand for programming language structure query language.It's used


programming language with SQL.

It have following syntax:-----

1.Deceleration section:-----<decleration part of any variable.

2.Begin section:----------<SQL command execute here(starting point of thed code)>

3.Exception section:--------<Display error in your command>

4.End section:--------<It's show closing of your program(ending point of the code)>

NOTE:----

------------------For output in PL/SQL:-------------

dbms_output.put_line('msg here');

---------------------------1.Decleration section:------------------------

If you want to decleare any variable then we use decleration part.

Synatx:-----varname data_type;

Ex:------a number;

NOTE:------If you want to decleare any variable then this is default part.

--------------------------2.Begin section :---------------------------

If you want to start your program of your logic then this part execute all SQL command
.This is essential part.

-----------------------3.Exeception section:-----------------

If any error genrated in our SQL command then this section display error.

NOTE:--It's optinal part.

--------------------------4.End section:------------------------

End is a Keyword, and indicate that program stopped from here.


NOTE:-----If you want to assign any value to variable and want to assign variable to value
and want to display with msg then we (concate) use following type.

Ex:------

//input:---- a :80;

dbms_output.put_line('the value of a = '|| a);

================Statement==============

There are three type of statement.

1.Conditional Statement

2.Looping Statement

3.Jump Control Statement

--------------------1.Conditional Statement:-----------------------

There are sone type of Conditional Statement.

1.If Statement 2.If Else Statement 3.Elsif Statement

4.Nested If Statement 5.Case Statement

-------------1.If Statement--------

Sy:- If Condition THEN

//block of code;

end if;

------------2.If Else Statement---------

Sy:--- if condition THEN

//block of code;

else

//block of code;

end if;
------------3.Else if Statement ------------

Sy:---if condition THEN

//block of code;

elsif condition THEN

//block of code;

.....................

else

//block of code ;

end if;

-------------4.Nested if Statement---------------

Sy:---

if condition THEN

if condition THEN

//block of code;

else;

//block of code;

end if ;

else

//block of code;

end if;

--------------5.Case Statement ----------------

Sy:- BEGIN

case var;
when condition1 THEN

when condition 1 then

.............

end case;

end;

---------------LOOPING--------------

--------For Loop------------

For loop is use to inniclization,condition,updation into single lineterminate semi colon.

Sy:- for varname In range

Ex:--for i in 1..10

LOOP

//block of code ;

end loop;

===============================================

--------------------------- JAVASCRIPT ------------------------------


JavaScript:-------------------
• JavaScript is a client (browser) side scripting language.

• JavaScript is developed by Brendan Eich in year 1995 under on Netscape


Corporation.
• It's old name Mocha.

• Now a day JavaScript is under on ECMA (European Computer Manufacturer and


Association Corporation).

• JavaScript is number 1 scripting language overall world.


• If you having knowledge of any programming language like as C, C++, Java or C#
then you can learn easily.
• JavaScript always writes into script tag within html file. You can also create a
separate file of JavaScript. But you have to save that file with .js extension.
• JavaScript is case sensitive.

• Javascript is a functional scripting language.

• It's scripting Language.

NOTE:---
=>If you have knowedge of any programming language like as C,C++,C#....... then
you can learn vary easily.

=>JS is always write into script tag within html file.

-----------------JavaScript Example------------------
<script type =”text/javascript”>

document. write(“Welcome in JavaScript”);


</script>

Explanation of Example:-

• <script>:- The script tag specifies that we are using javascript.


• The text/javascript is the content type that provides information to the
browser about the data.

• The document.write () function is used to display dynamic content through


JavaScript.

-----------------Syntax of javascript:----------------------
<script>//javascript code here…..

</script>

NOTE:----JS have No data_type. If you want to declare any variable, then we use
(var) keyword.

That is a case sensetive langauge.

-----------------Input/Output Function:--------------

-------------------------Input Function-----------------

There are two input function in JS .


a).prompt()

b).confirm()

1.prompt():-----> it's also input the value of string type but if user input
int,float,double......etc them he convert it.

Sy:----> var a;

a=prompt("message here");

2.confirm():-----> Confirm method is also a input method,it return the value of Boolen
(true || false)type.

Sy || Ex:----> var varname=confirm("confirmation msg here");

-------------------Output Function-------------------------

There are two output function in JS():--

1.alert() 2.write()

---------------1.Alert:-------------

It's use to display or show the result (msg) in alter windows.

Sy || Ex:----> alert("msg here");

--------------2.Write :--------------

It's also a output function. It can't call directely,it's call with of a DO(Document Object).

Sy || Ex:-----> document.write("msg here");

------------------TYPE CASTING----------------

Convert one data type to another data type, then this process is known as typecasting.

Datatype converstion:-----> If you want to convert string value to into another type of
value then we use following method.

Ex:----> parseInt(string_value),parseFloat(),parseDouble()...etc.

----------------------Statement-----------------
Note:----Same like as C language.

-----------1.Conditional Statement-----------

a).If Statement:----------->

Sy:---> If(condition) /this is a true block.

//block of code

b).If else Statement:------>

Sy:---> if(condition)//true block

//block of code ;

else //false block

//block of code;

3.Else-If :--------> Ladder if (else-if) .By using ladder i fbe can check multiple condition at
a time but only one condition will be execute at a time.

Sy:---->if(condition1)

//block of code ;

else if

{
//block of code;

........................................

else

//block of code ;

-------------------------------Switch Statement :-------------

Switch is a keywords.It's also used in conditional statement.

It's work case control statement.Default block is used in switch statement.

We can pass int,char,value into switch case has variable.

Sy:---->

switch(varname)

case 1:

//block of code;

break;

case ....:

//block of code;

..............

default:

//b lock of code;


break;

-------------Looping------------

If you want to execute block of code again and again based on condition, than this
process is known as Looping.

Type of loop:-----

1.For loop 2.While loop 3.Do-while loop

1.For Loop:-------> Sy:---->for(initilaization;condition;updation)

{ //block of code ; }

2.While Loop:----->Sy:---->

initilization;

while (condition)

{//body of loop;

//updation; }

3.Do-while:----------->

Sy:--> initilization

do

//body of loop;

//updation;

while(condition);

---------------Get Element by id-------------


getElementById():----It's use to hold the id of html control and return the object of that
control.

It's used to get the element,tag,objects in html used by getElementById.

Sy:------getElementById("idname");

Ex:-----

<input type="text" id="a1">

getElementById("a1").value;

---------------------------Function-------------------------------

Function:------Function is the block of code that performs a particular task.

Function can be call by name.

If you want to create a function keyword.

Sy:----function functionname()

//block of code;

Ex:------function f1()

//block of code;

-------------------------ARRAY-----------------------------

We know that array is the collection of similar data type, But in JS have no data type.

Array is the collection of similar or dsimilar dat_type.

Sy:-------

1.var array_name =["value1,value2.......valueN"];


Ex:------var name=["Abhijeet","Tushar","Devank"];

Sy:-----

2.var array_name=new array(size);

Ex:-----

var arr=new array(5);

var[0]="Ram";

var[1]="34"

var[2]="90"

...............

var[4]="87"

NOTE:------The initilazation of an array is start from 0 to n-1 where n is the length of an


array.

var color=["red","black","blue","orange"];

Note:----If you want to find the length of an array then we use length property.

----------------------Events--------------------

There are some event are use.

1.onclick():---

2.onchange():-----

3.onmouseover():----

4.onmouseout():-----

5.onload():-----

6.onkeypress():----

7.onkeypressout():-----

8.onkeyup():----
-----------------InnerText and InnerHTML:----------------------

InnerText property are used to set/get any normal text of selector html element.

Sy:---->var x;

x=document.getElementById("Id of html element").ineerText="Ram";

Ex:----><div id="b1">Hello</div>

<input type="text" id="txt">.value;

document.getElementById("b1").innerText;

Sy:--->innerHTML

document.getElementById("b1").innerHTML;

Ex:---->

x=document.getElementById("b1").innerHTML="<h1>RAM</h1>";

-------------------------------Validation ---------------------------

Validation is used to validate the data,there are two type of validation.

1.Client Side Validation 2.Server Side Validation

1.Client Side Validation:-----------> Client Side Validation ,It's Validate On The Browser
and use the client side programming language.

Ex:----->Like as:- javascript,vbscript,jscript,Type script ........etc.

2.Server Side Valdation:----> It's used by server side Technologies.

Ex:----->Like as:-PHP,ASP,JSP,SERVLET,PYTHON....etc.

------------------------------This():---------------------------

In a JS this() is a keyword,this keyword is forword a object , that is execute the current


piece of code.

It's refrence to forword current execution function.

------------------------Array of Object:--------------------------
Is the collection of smillar datatype but array of object is the collection of array.

Syntax:-

Var arrayofobjectname=[{property:”value”},{property:”value”}];

Ex:-

Var student=[{name:”ram”,age:20},{name:”name:”Shivam”,age:20}];

ASP.NET WITH MVC FRAME WORK


C#:--- Console

ASP.NET With MVC FREAME WORK

------------------------------------------

1.Entitiy Framework with CRUD

2.ADO.NET with CRUD

3.ADO.NET with Store Procedure(CRUD)

4.CRUD with Json

--------------------------------

Project Work

Demo Project with Entity FrameWork

---------------------Asp.Net MVC Framework:-----

MVC stand for Model view and controller.

MVC concept into .Net froamework is version of incremented of ASP.Net ,so it is called
Asp.net mvc framework.

It's developed by Scott Guthrie in year 2008.

Model <------>Controller<------->View
Source Code ------------> IL Code (Byte Code)------>CLR------>Intel/IBM

JIT(Just In Time)

• Comman Language Runtime [CLR]

• Comman Type System[CTR]

• Just In Time [JIT]

• Garbage Collection [GC]


--------------------------------C#--------------------------------

C# is a object oreinted programming language.

it's Developed by Microsoft in year 2000.

------------How we can create console application by using C#?---------

Open Visual Stdio --->File---->NewProject----->Choose Visual C# and Console


Application.

-------------What is Name Specieses------

It's same like as header file. It's the collection of classes and classes is the collection of
methods and variables.

-------------Type of name speases:-------

1.Built in /Predefine/Library Function

If you want to use any built in name space then we used using keyword.

NOTE:------>The main name space of C# is system.

2.UDF

The name space that is define by user is called the user define name space.

NOTE:--->If you want to define any name space then we used name space
keyword.
Sy:----->

namespace Namespace

//coding.................

--------------Output method:------------

1.Write()-----

Sy:---> Console.Write()

2.WriteLine():-----

Sy:-->Console.WriteLine()

--------------------Input method:--------------

1.Read()-->It return ASCII value of any charater and return into int formate.

2.ReadLine()------>It return always string value.

Sy:---> string n;

n=Console.ReadLine();

3.ReadKey()---->It read single character and same like a getch() method.

Note:----->All above methods are available into Console class and Console class is
available into System name Space.

-----------------Type Casting/Data Type Casting:----------

When we convert one data type into another data type then weused type casting.

1.C or C++ method-----------

Float x=56.89;
int a;

a=(int)x; //56

2.Parse() method:--- We can also convert data type by using parse() method.

Ex:----> int a;

a=int.Parse(Console.ReadLine());

3.Convert() method-------------

It provide built-in methods for data type casting.

Ex:-----ToInt32(),ToFloat(),ToDouble(),ToString().

Convert.ToFloat(Console.ReadLine());

----------------------------String in C#------------------

Collection of Characters.

string name="ABHI";

-------------------Loop-------------------

1.Indexed Base

a).Entry Control

I.While II.For

b).Exit Control I.Do While

2.Collection Based

a).ForEach

[Note:---->Classic ASP,ASp,ASP.Net,ASP.Net MVC,ASP.Net MVVC,Blazer,ASP.Net


Core]

--------------ForEach------------
It's also a keyword .it word on collection.

Sy:---->foreach(Return_Type VarName in Collection_Name)

//code here;

Ex:-------> string name="ram"

foreach(char ch in name)

//print a;

----------------------------------Array in C#-----------------------------------------

1.1D Array:------------>Array is the collection of similler data type.

Sy:--->Data_Type[] Array_name=new Data_Type[size];

Ex:---->int[]list=new int[10];

2.2D Array:-------------> It have Only single sub-script but seprated by comma oprator.

Sy:-->Data_Type[,]Arryname=new Data_Type[rows,colums];

Ex:---> int[,] list = new int [3,2];

-------------------String Built-in Function-----------------

1.IndexOf():------> It check index by index of any character.

string name="ABHI";

name.IndexOf('A');

2.LastIndexOf()------>It return last index of any character.


string img = "a.jpg";

string s = img.Substring(img.LastIndexOf('.')+1);

3.ToUpper()----------> It convert all character small into capital letter.

4.ToLower()---------->It convert any string into Lower case.

5.substring()---------->When we cut any string from given string then cut string is
called substring.

--------------------Params Array-------------------

When we pass any array into parameter of any function by using params keyword.then
it is called params array.

---------------Function---------------

That is a two type of function.

1.Built-in Function 2.UDF(User Define Function)

UDF(User Define Function):---> It's also four type of function.

1.No Return Type No Passing Parameter

2.No Return Type But Passing Parameter

3.Return Type No Passing Parameter

4.Return Type But Passing Parameter

NOTE:-----> We can define any function into class static or no-static.

1.Syntax:---->Return_Type Functio_Name(Parameter)

//block of code;

Ex:----> void f1()


{

//code block;

-----------------OOPS---------------------

It is not a programming language.It's also a concept only.

There are some Features of OOPS.

1.Class

2.Object

3.Inheritance

4.Polymorphism

5.Encaptulation

6.Data Abstraction

-----------------------1.Class----------------------

Class is a keyword and it is also a UDF Data Type.It is also known as a Wrapper.Class is
also a Collection of the Data Members and Data Methods.

Syntax:-->Class Class_Name

//Data Member

//Data Method

-----------------------2.Object---------------------

Object is a Real Word Entity.It have thing state and Behaviour.

Syntax:---->Class_Name Object_Name = new Constractur_Name();


Example:---->Class1 cm = new Class1();

----------------------3.Inheritance ---------------------

Inheritance is also Feature of an OOPS we can inherit one class by using another class.The
single that is used to inherit by second class then second class is called the
Child/Base/Derrived and first class is called the Parent /Root Class.

NOTE:---->if you want to inherit of any parent class then we used colon(:) symbol.

Synatx:----class A //parent

//code

class B:A //child class

//code

----------------------Type of Inheritance -----------------------

1.Single Level Inheritance :------>When we have Only single parent class and single child
class.

2.Multi Level Inheritance :-------> It have many Level . one class inherit to other class and
other to next.

This Process continue so it is called multi Level Inheritance.

3.Multiple Inheritance :-------> Note:---It is not supported On Java or C# .because it is not


matched to real world.But By using interface we can used this concept.

------CLASS---------

1.it is a UDF data type.

2.If you want to define any class then we used class keyword.
3.Method definitation and decleration both inside called of class.

-----INTERFACE-----

1.It is also a UDF Data type.

2.It want to define any interface then we used interface keyword.

3.we can declare only of any method.

-----------------4.Polymorphism-----------------------

One thing represent many form is called polymorphism.

There are two type of Polymorphism.

1.Compile Time Polymorphism. ( Method Over-loading )

2.Run Time Polymorphism. ( Method Over-riding ).

-------------1.Compile Time ---------------

Method Overloading :----> When we have same name of any method but paramenter
are change then this type of method is called Method Overloaded and this process is
know as Method Overloading.

------------------2.Runtime ----------------

Method Overriding :------> When we have same name and paramenter of any method
inside of parent and child class then parent class method body is overriding by child class
method.

-----------------5.Encaptulation---------------------

We can bind multiple data info single unit is called Encaptulation.

Ex:---- TV,CARS,MOBILE...ETC.

------------------Constractur:---------------

It is a special data member of class. It have no any return type not even void().It always
remain Public.

It never call when we create an object of any class then it callled Automatically.Every Have
a Default constructor.
Type Of Constructor :

1.Default Constructor

2.Parametrized Constructor

3.Copy Constructor.

-----------------6.Data Abstraction----------------

Data Abstraction or Data Hiding or Access_modifire of Access_Spacifire.

It is used to define the scope of methods inside of class.

It have following keywords :-----------

1.Public -----------> Global Access.

2.Procted ---------->Only Level Accecing.

3.Priveate --------->Only same Class access.

--------------------------------------ADO.NET --------------------------------

ADO is stand for Active-X Data Object.

It is used to database connectivity.

It provide built-in classes and methods

for database connectivity:-->

1.SqlConnection :---- It is used to establish connction between ms sql server and vs


,means it establish a virtual connction.

It provide following method and property:-----

1.Open():---->It is used to open the current connction.It is a non-static method inside of


SqlConnection class.

Ex: object.Open();

2.Close():---> It is used to close of current connction string.

Ex:---Object.Close();
3.State:---> It is used to check of current connction state.

Ex:-----Object.State;

2.SQL Command:----- It contain SQL command and provide some methods for execution
of that commands.

ExecuteNonQuery():----- It always return the number of affected rows and number of into
int formate. So it return type is int.

Ex:---> object.ExecuteNonQuery();

1.SqlDataAdapter():---- It used to feach whole tabledata.

Fill():-----> It is a Bulit-in method of SqlDataAdapter . It is uesed to fill data into Data


table.

DataTable:-------- It have single tabledata.It is available into system .

Data namespace.

---------------------------------------------------------------------------------

-----------------JQUERY--------------------------

jQuery:-

jQuery is a javascript library


jQuery is developed by John Resig in year 2006

jQuery is not a programming language it is totally in javascript.


Syntax of jquery:-

$(document).ready (function (){


//code here.........
})
$- Factory method
document -built-in object of page class
ready-load event method
function()-anonymous method
• $():-

$ is a factory method and it is replacement of jQuery() method. Without


$(doller) we can not call any method of jQuery library.
Note: - document - Current control ko hold karta hai

2. document:-

It contains all control of HTML page(DOM).


3. ready ():-

ready () is also a method that is used to ready for all event .load event.
4. Anonymous method:-

Anomymous method call automatic, it is without naming


method.
Syntax:-

function(){
//code................
}
Input from input control by using jQuery:-

<input type="text" id="t1"/>


Example:-

var t=document.getElementById ("t1").value;

jQuery syntax:-

var t=$("#t1").val ()
value=val()
innerText=text()
innerHTML=html()

Date: - 05/12/2020

Some built-in method of jQuery:-

1. val ()
2. text()
3. html()
4. attr ()
attr ()

• Html me attribute ko get karane ke liye attr() method


ka use kiya jata hai. like height, type, width......etc

Syntax:-

$(selector).attr (function () {
//code here......
});

5. prop ()

get and set value syntax in jquery:-

Note - prop (), attr () parameterize method hai


Example:-
<input type="text" id="t1" value="10" height="200"/>
var a=$(selector).attr("attributename");//get image
var a =$("#im1").attr ("src");

var a =$("#im1").attr ("src", a ya "image name");


var x=$("#t1").val();
$("#t1").val("Rinka");

Some Anonimation method:-


1. animate ()

2. css()

3. fadeIn()

4. fadeOut()

5. fadeToggle ()

6. show()
7. hide()

8. toggle()

9. slideUp()

10. slideDown()

11. slideToggle()...........etc

Calling of above method:-

$("selector").methodName ();
animate ()
It is used to animation that is used to move one control from one place to another
place. otherwise you can also apply another effect of animation by using animate
method.

Syntax:-
$(selector).animate ({property: value...}, delay);

Date: 07/12/2020
Some Important built-in function:-

1. css ()

2. addClass ()

3. append()

4. removeClass()

5. prepend()

• css():-

It is used to apply dynamic css on any control.

Syntax:-

Note: - To apply single property.

$("selector").css("propertyname","value");

Syntax:-

$("selector").css({“property name”:”value1”,.........});
• addClass method:-

addClass () method is used to add the css class dynamically.

Syntax:-
$("selector").addClass("ClassName");

Ex.

<img src="" class="im"/>

.im

• removeClass:-

removeClass() method is used to remove of current apply class.

Syntax:-
$("selector").removeClass ("ClassName");

• hasClass():-

hasClass() method is used to check apply class is already apply or not.

• append():-

append() method is used to append data into last of current selector.

Syntax:-

$("selector").append ("data here..");


Most important

find() find element


each() loop(find indexing)

eq()

Date – 10/12/2020

Query String:-
If you want to send the value from one page to another page then we used this concept.

Syntax: for sending single

PageNamewithExtension? VarName=value;

Example:-
p1.html?21;

Syntax:for sending multiple value


PageNamewithExtension?VarName1=value1&VarName2=value2&VarName3=value3......in
finite

URL:-

URL is a class that has built parameterized constructer to get current page url.it search
query string variable value with the help of searchParams property.
Syntax: var p=new URL(page URL).searchParams;
get() method:-
get () method is used to get the value from query string by using query string
variable.this method is define into URL class.

Example: - var x=p.get (‘a’);

------------- JavaScript Programming Language---


JavaScript:-
• JavaScript is a client (browser) side scripting language.

• JavaScript is developed by Brendan Eich in year 1995 under on Netscape


Corporation.
• It's old name Mocha.

• Now a day JavaScript is under on ECMA (European Computer Manufacturer and


Association Corporation).

• JavaScript is number 1 scripting language overall world.


• If you having knowledge of any programming language like as C, C++, Java or C#
then you can learn easily.
• JavaScript always writes into script tag within html file. You can also create a
separate file of JavaScript. But you have to save that file with .js extension.

• JavaScript is case sensitive.

• Javascript is a functional scripting language.

• It's scripting Language.

NOTE:---
=>If you have knowedge of any programming language like as C,C++,C#....... then
you can learn vary easily.

=>JS is always write into script tag within html file.

JavaScript Example:-
<script type =”text/javascript”>
document. write(“Welcome in JavaScript”);

</script>
Explanation of Example:-

• <script>:- The script tag specifies that we are using javascript.


• The text/javascript is the content type that provides information to the
browser about the data.

• The document.write () function is used to display dynamic content through


JavaScript.
Syntax of javascript:-

<script>//javascript code here…..

</script>
NOTE:----JS have No data_type. If you want to declare any variable, then we use
(var) keyword.

That is a case sensetive langauge.

Three Places to put javascript code:-


• Between the body tag of html
• Between the head tag of html
• In .js file (external javascript)

• Between the body tag of html

Syntax:-

<html>

<head>
<title></title>

</head>

<body>

<script type=”text/javascript”>

alert(“Hello JavaScript”);

</script>
</body>

</html>
• code between the head tag

Syntax:-
<html>
<head>
<script type="text/javascript">
function msg(){
alert("Hello Javatpoint");
}
</script>
</head>
<body>
<p>Welcome to JavaScript</p>
<form>
<input type="button" value="click" onclick="msg()"/>
</form>
</body>
</html>

• In .js file (external javascript)msg.js


function msg()
{
alert("Hello Rinka");
}

<!--link .js folder --->

<html>

<head>

<title></title>

<script type="text/javascript" src="msg.js"></script>


</head>

<body>

<p>Welcome to JavaScript</p>

<form>
<input type="button" value="click" onclick="msg()"/>

</form>

</body>

</html>

==========================================

--------Javascript Displaying Possibilities:---------


===========================================

JavaScript can "display" data in different ways:

• Writing into an HTML element, using innerHTML.


• Writing into the HTML output using document.write ().
• Writing into an alert box, using window.alert ().
• Writing into the browser console, using console.log ().

• Using innerHTML:-
<html>
<body>
<h1>My First Web Page</h1>
<p>My First Paragraph</p>
<p id="demo"></p>
<script>
document.getElementById ("demo").innerHTML = 5 + 6;
</script>
</body>
</html>
2. Using document.write ():-
<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph</p>
<script>
document.write (5 + 6);
</script>
</body>
</html> <html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph.</p>

<script>
document.write(5 + 6);
</script>

</body>
</html>

• Using window.alert():-

<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph</p>
<script>
window.alert(5 + 6);
</script>
</body>
</html>

• Using console.log:-
<html>
<body>
<script>
console.log(5 + 6);
</script>
</body>
</html>

Use of javascript:-

We can use javascript as per following types.

• Inline javascript:-

We can write js direct into event handling.

2. Internal javascript:-

We can write javascript inside of html page by using script tag.

3. External javascript:-

We have a separate file of js and link into html page by using script tag.

Syntax:-

<script src="file name with extension"></script>

Object Oriented programming language with javascript:-

Object oriented programming language is a methodology or concept of


programming language.
Every thing is an object into real world. Object having state and behaviour.
Object oriented programming language having some following features:-

1. Class
2. Object

3. Inheritance

4. Polymorphism

5. Encapsulation

6. Data Abstraction

7. Message Passing

1. Class:-

Class is a keyword that is used to define of any class. Class is also a user define
data type. Class is collection of data members (variable) and data method
(function).

Syntax:-
class className

//data members

//data methods

}
Example:-

class student

//data members
//data methods

• Object:-
Object is a real world entity. It provides the reference of any class variables
and methods.

Syntax:-

ObjectName=new className ();

Example:-

Obj=new student ();

• new is a keyword.

Date: 01/12/2020

Inheritance:-
Inheritance is also a feature of object oriented programming language. We
can create a new class by using existing (old class) class. The old class is called the
parent/node/base class and new class is called the child/derived class.

Type of inheritance:-
1. Single inheritance

2. Multi level

3. Multiple-----not support

• Javascript me kisi class ko dusri class me inherit krne ke liye extends keyword
ka use kiya jata hai.

• If you want to inherit any class by using another class then we used extends
keyword.

• Child class ke dwara base class ke sbhi property ok access kr sakte hai isliye
hm childe class ka object bnate hai.

1 Single Inheritance:-

It have only single base class and single child class.

Syntax:-

class A //parent class

{
//code here....

class B extends A //child class

//code here.....

}
2. Multi level inheritance:-

class A //super class

//code here…..

class B extends A //parent class

{
//code here………

class C extends B //child class

//code here…..

Task: 01/12/2020

1. Live Google location find by using Google map API

2. Create a timer by using javascript

Watch Timer: 00:00:01

start button stop button Reset


Date 03/12/2020

Polymorphism:-

Polymorphism means one thing, multiple forms.


Example-joker

Note:-Overloading me method ka name same hota hai parantu parameter


different hota hai.

Type of polymorphism:-

There are two types of polymorphism-

1. Compile time polymorphism (method overloading)

2. Run Time polymorphism (method overriding)

1. Method Overloading:-

Method name will be same but parameter is changed.

Syntax:

Sum (a, b)

Sum (a)..........etc.
Note: Type of method in c programming language-

• Formated

Printf (), scanf ()……………..etc


• Unformatted

Gets(),getch()………etc

2. Method overriding:-

One method define into parent class and any user want to define same method
with parameter into child class then the body of parent class method override by
child class method.

Syntax:-

class A
{

f1()

//code here

class B extends A
{

f2()
{

//code here

You might also like