#include <stdio.h>
int main()
{
char a[]="aeiou";
char *p;
p=a;
printf("%c\n",++*p);
puts(a);
return 0;
}
#include <stdio.h>
int main()
{
char a[]="aeiou";
char *p;
p=a;
printf("%c\n",++*p);
puts(a);
return 0;
}
#include <stdio.h>
int main()
{
char a[]="aeiou";
char *p;
p=a;
printf("%c\n",(*p)++);
puts(a);
return 0;
}
#include <stdio.h>
int main()
{
char a[]="aeiou";
char *p;
p=a;
printf("%c",*p++);
puts(a);
return 0;
}
int main()
{
int a[]={10,20,30,40};
int *p,i;
p=a;
printf("%d ",*a+1);
printf("%d ",*p);
//for(i=0;i<4;i++)
//printf("%d ",a[i]);
return 0;
}
int main()
{
int a[]={10,20,30,40};
int *p,i;
p=a;
printf("%d ",*(a+1));
printf("%d ",*p);
//for(i=0;i<4;i++)
//printf("%d ",a[i]);
return 0;
}
int main()
{
int a[]={10,20,30,40};
int *p,i;
p=a;
printf("%d ",*++p);
printf("%d ",*p);
for(i=0;i<4;i++)
printf("%d ",a[i]);
return 0;
}
int main()
{
int a[]={10,20,30,40};
int *p,i;
p=a;
printf("%d ",++*p);
printf("%d ",*p);
for(i=0;i<4;i++)
printf("%d ",a[i]);
return 0;
}
int main()
{
int a[]={10,20,30,40};
int *p,i;
p=a;
printf("%d ",*p++);
printf("%d ",*p);
for(i=0;i<4;i++)
printf("%d ",a[i]);
return 0;
}
void f()
{
static int a=5;
int i;
for(i=1;i<=4;i++)
{
a=10;
printf("%d",a++);
}
}
int main()
{
printf("Hello World");
f();
return 0;
}
void f()
{
//static int a=5;
int i;
for(i=1;i<=4;i++)
{
static int a=10;
printf("%d",a++);
}
}
int main()
{
printf("Hello World");
f();
return 0;
}
Comments in JAVA SCRIPT.
Use of alert(),confirm(),prompt()
popup box
Operators: i) Arithmetic ii) Relational iii)Assignment iv) Increment v)Decrement vi) conditional vii) logical
break and continue
client side java script,server side javascript
DHTML
widget
main objects used in java script
direct and indirect embedding
Array:
declaration ,initialization
sorting
Array objects and methods -join(),concat(),shift(),slice(),splice(),unshift(),sort(),push(),pop(),reverse()
function:
4 type of function
scope of variable and arguments
Date objects and methods
global function
string:
string object and methods
form and event handling:
properties and methods of form
event registration
text, text area, checkbox, radio button, button, select element
mouse event, keyboard event
intrinsic event
methods of document object, window object
Regular expression
matching character, matching word
validation check
replace word
event bubbling
event listener
Dom
child, parent
Exception handling
get(),post()
# Take input from user
num = int(input("Enter any number : "))
temp = num
product = 1
sum=0
while(temp != 0):
product = product * (temp % 10)
sum = sum + (temp % 10);
temp = int(temp / 10)
print("\nProduct of all digits in", num, ":", product)
Strong Number in Python::
sum=0
num=int(input("Enter a number:"))
temp=num
while(num):
i=1
fact=1
rem=num%10
while(i<=rem):
fact=fact*i
i=i+1
sum=sum+fact
num=num//10
if(sum==temp):
print("Given number is a strong number")
else:
print("Given number is not a strong number")
# Python progam --- Perfect Number by using For_loop
Input_Number = int(input("enter a number"))
Sum = 0
for i in range(1, Input_Number):
if(Input_Number % i == 0):
Sum = Sum + i
if (Sum == Input_Number):
print("Number is a Perfect Number.")
else:
print("Number is not a Perfect Number.")
Python program to display all the prime numbers within a range
lower = int(input("enter a number")
upper = int(input("enter a number")
print("Prime numbers between", lower, "and", upper, "are:")
for num in range(lower, upper + 1):
# all prime numbers are greater than 1
if num > 1:
for i in range(2, num):
if (num % i) == 0:
break
else:
print(num)
Python Program to Check Prime Number
num = int(input("Enter a number: "))
flag = False
if num == 0 or num == 1:
print(num, "is not a prime number")
elif num > 1:
for i in range(2, num):
if (num % i) == 0:
flag = True
break
if flag:
print(num, "is not a prime number")
else:
print(num, "is a prime number")
Factorial of a Number using Loop
num = int(input("Enter a number: "))
factorial = 1
if num < 0:
print("factorial does not exist for negative numbers")
elif num == 0:
print("The factorial of 0 is 1")
else:
for i in range(1,num + 1):
factorial = factorial*i
print("The factorial of",num,"is",factorial)
Python Program to Check Leap Year;:
year = int(input("Enter a year: "))
if (year % 400 == 0) and (year % 100 == 0):
print( year, "is a leap year")
elif (year % 4 ==0) and (year % 100 != 0):
print( year, "is a leap year")
else:
print( year, "is not a leap year")
Python Program to Find the Largest Among Three Numbers:
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
num3 = float(input("Enter third number: "))
if (num1 >= num2) and (num1 >= num3):
largest = num1
elif (num2 >= num1) and (num2 >= num3):
largest = num2
else:
largest = num3
print("The largest number is", largest)
Python Program to Check if a Number is Odd or Even;
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even".format(num))
else:
print("{0} is Odd".format(num))
1. Program name :A=07H,B=08H,A=A+B.Find the content of A and B.
2. Program name : B=10,C=12,D=B+C.Find the content of D.
3. Program name:B=(200) BASE 10,C=B’(1’s complement of B).Find the content of C.
4. Program name :D=(200)10,C=2’s complement of D.Find the content of C.
5. Program name :D=-1,B=+1,C=B+D.Find the content of C.
6. Program name :D=55H,E=56H,C=D-E.Find the content of C.
7. Program name :D=55H,E=56H,H=D-E using 2’s complement addition.Find the content of H.
8. Program name :B=20H,C=30H,Swap B & C.Find the content of B & C.
9. Program name :Swap the content of 5000H and 3000H.
10. Program name :3000H=data1,4000H=2’s complement of data1.Find the content of 4000H.
11. Program name :3000H=data1,3001H=data2,3002H=data1+data2.Find the content of
3002H.
12. Program name :3000H=data1,3001H=data2,3002H=data3,3003H=data1+data2+data3.
Find the content of 3003H.
13. Program name :3000H=data1,3001H=data2,3002H=data1+data2,3003H=data1-data2.
Find the content of 3002H and 3003H.
14. Program name :A=20H.Add data byte 30H with immediate Acc with carry 1.
15. Program name :A=20H.Add data byte 30H with immediate Acc with carry 0.
16. Program name : A=20H,B=30H.Add register B to Acc with carry 1.
17. Program name :A=20H,B=30H.Add register B to Acc with carry 0.
18. Program name :A=20H.Add the data byte 30H immediate to Acc .Find the content of Acc
after execution
19. Program name :A=FFH,B=88H,data byte=11H.C=11H AND Acc,D=C AND B.Find the
content of C and D.
20. Program name :A=FFH,B=88H,Data byte=11H.C=11H OR Acc,D=C OR B.Find the content
of C and D.
21. Program name :A=FFH,B=88H,Data byte=11H.C=11H XOR Acc,D=C XOR B.Find the
content of C and D.
22. Program name :1st law of DeMorgan’s Theorem:(A+B)’=A’.B’.C=LHS & D=RHS.When
A=01H & B=00H,then find the content of C and D.
23. Program name :2nd law of DeMorgan’s Theorem:(A.B)’=A’+B’.C=(A.B)’ & D=A’+B’.When
A=01H & B=00H,then find the content of C and D.
24. Program name :Acc=10H,B=20H;A=Acc+B (Using Jmp instruction).
25. Program name :A=0AH.After RAL(Rotate Acc Left) move the result in C.Find the content of
C.
26. Program name :A=0AH & Carry=1.After RAL(Rotate Acc Left) move the result in C.Find the
content of C.
27. Program name :Input a number in C register & then multiply with 4 & save it into D
register.Find the content of D.
28. Program name :16 bit addition.4000H=Data 1(L),4001H=Data 1(H),4002H=Data 2(L),
4003H=Data 2(H).4004H=Sum(L),4005H=Sum(H).Find the contents of 4004H & 4005H.
29. Program name :Sum(16 bit) of two 8 bit datas.4000H=data 1,4001H=data 2,
4002H=Sum(L),4003H=Sum(H).Find the content of 4002H & 4003H.
30. Program name :4000H=data 1.If data 1 is even no.,then D=00H,otherwise D=01H.
31. Program name :4000H=data 1.If data 1 is even no.,then D=00H,otherwise D=01H.Do it
using If-else.
32. Program name :5000H=data 1.If data 1 is +ve,then store 5001H with FFH,otherwise store
with 00H.
33. Program name :1+2+3+.....+10(using loop)
34. Program name :1+2+3+.....+100.Result=8 bit.Store the result in D register.Find the content
of D.
35. Program name :1+2+3+.....+50.Result=8 bit.Store the result in D register.Find the
result(content of D).
36. Program name :1+2+3+...+100=Sum of series=16 bit.D=Sum(H),E=Sum(L).Find the
content of D and E.
37. Program name :2500H=data 1,2501H=data 2,2502H=data 3,25003H=data 4.
3000H=Sum(H),3001H=Sum(L).Find the content of 3000H and 3001H.
38. Program name :3000H=data.If no. is even positive,then store FFH in D register,but if it is
even negative,then store FFH in E register.
39. Program name :3000H=data.If no. is even positive,store 3001H with AAH,if even
negative,then store 3001H with BBH,if odd positive,store 3001H with CCH,if odd negative,then
store 3001H with DDH.
40. Program name :3001H=data 1,3001H=data 2,3002H=data 3,3003H=data 4.3004H=total
number of even number,3005H=total number of odd number.Find the content of 3004H &
3005H.
41. Program name :3000H=data 1,3001H=data 2,3002H=data 3,3003H=data 4.4000H=even
positive,4001H=even negative,4002H=odd positive,4003H=odd negative.
42. Program name :Memory Implementattion
43. Program name :5000H=11H,5001H=22H,5002H=Sum(8 bit).Find the content of 5003H.
44. Program name :Sum of 10 numbers,result=8 bit,starting memory location is
5000H.5000H=data 1,5001H=data 2,........,5009H=data 10.
45. Program name :Sum of 10 numbers,result=16 bit,starting location=5000H.
6000H=(sum)lower , 6001H=(sum)upper.Find the content of 6000H & 6001H.
46. Program name :Sum of n numbers(n=11),A=result=8 bit,starting location=5000H.Find A.
47. Program name :Sum of n no.,result=16bit.6000H=(sum)upper, 6001H=(sum)lower
48. Program name :HL=5000H,DE=3000H.Exchange HL & DE.
49. Program name :Block transfer(10 data).3000H=data 1,3001H=data 2,...3009H=data
10.result will be 5000H=data 1 of 3000H,.......5009H=data 10 of 3009H.
50. Program name :B=22H,C=22H.Compare B & C register,if B=C,then D=FFH,otherwise
D=00H.
51. Program name :LINEAR SEARCH:Count the total number of 0 from an array of n-bit.
52. Program name :Count the total number of FFH from an array of n-bit.
53. Program name :Count the total number of even number & odd number (using memory).
54. Program name :Input a no. from memory location 3000H & convert it into ASCII & save it in
4000H.
55. Program name :Input-->3000H=data 1...Output-->4000H=(a)0 for invalid no. , (b)1for valid
no.....4001H=(a)00 for invalid no., (b)ASCII for valid no.
56. Program name :INPUT-->4000H=data 1,4001H=data 2,4002H=data3
.OUTPUT-->5000H=largest number.Find the content of 5000H.
57. Program name :BINARY TO GRAY CODE:--Input a number from 3000H & convert the no.
into gray code & store it in 4000H.
58. Program name :MULTIPLICATION USING REPEATED ADDITION(4 bit*4bit =8bit):------
5*3=15.
59. Program name :MULTIPLICATION USING REPEATATIVE ADDITION(8bit *8bit = 16bit):-
10H * 11H.[(16)10*(17)10]
60. Program name :Count the total number of 1 of 8 bit number.
61. Program name :Count the total number of 0 &1 of a 8bit number.
62. Program name :Palindrome checking:-Input-->3000H=data.Output-->4000H=00H if not
palindrome,otherwise store FFH.
63. Program name :Seperate 2 nibbles:--3000H=10100111(A7H).4000H=upper
nibble=00001010 , 4001H=lower nibble=00000111.
64. Program name :3000H=data.4000H=FFH if two nibbles are equal,otherwise store 00H.
65. Program name :3000H=data.,right shift 4 times,then store the output in 4000H.Find the
content of 4000H.
66. Program name :BCD to binary:-data=00100110=26H(BCD)=38(binary).Convert the binary
number into 26H.
67. Program name :MULTIPLICATION USING ADD & SHIFT METHOD:
Input-->3000H=multiplicant,3001H=multiplier.Output-->3002H=upper part of product
,3003H=lower part of the product.
68. Program name :DIVISION USING REPEATATIVE SUBTRACTION:I/P->D=0BH(dividend),
E=03H(divider)..Output-->B=Quotient , D=Remainder.Find out the contents of B & D.
69. Program name : Replace all 0’s with FF in the array.
70. Program name :Count the total no. of element which is greater than 55H.
71. Program name :Add content of two memory location.
72. Program name :Sub two 16-bit no.,result 16 bit.
73. Program name :8-bit data shift left,1 bit.
74. Program name :8-bit data shift right,1 bit.
75. Program name :Largest number of n-numbers.
76. Program name :Smallest number of n- numbers.
77. Program name :Gray to binary conversion.
78. Program name :Ascending order sorting(using bubble sort)
79. Program name :Descending order sorting(using bubble sort).
80. Program name :Place the content of the memory location FC50 in register B & that of
FC51 in register C.The content of FC50 & FC51 are 11H &12H respectively.
81. Program name :Place 05 in the Acc,increment it by one & store the result in the memory
location FC50H.
82. Program name :Add two 8-bit decimal number,result 16 bit.
83. Program name :8-bit decimal subtraction.
84. Program name :1’s complement of a 16-bit number.
85. Program name :2’s complement of a 16-bit number.
86. Program name :8-bit data shift left,2bit.
87. Program name :16-bit data shift left,1-bit.
88. Program name :16-bit data shift left,2-bit.
89. Program name :Find the square from look-up table.
90. Program name :Find the larger of 2 number.
91. Program name :Smallest of 2 numbers.
92. Program name :Sum of a series of 8-bit decimal number,result 16-bit.
93. Program name :Multibyte addition.
94. Program name :Multibyte decimal addition.
95. Program name :Sum of a series of multibyte decimal number.
96. Program name :Seperate the odd and even numbers from an array of 5 numbers.
97. Program name :Move a block of 10 data stored from F101H to FI0AH to a target location
from F020H to F029H in the reverse order in which they are actually stored.
98. Program name :Memory bloack transfer in overlapping order.
99. Program name :Add an array of 3 16-bit hex. No. and subtract 48H.
100. Program name :Fibonacci series.
101. Program name :Fibonacci series upto n-no. Which are greater than 0AH and smaller
than 1EH.Output stored from F100 → 0D,15.
102. Program name :Factorial of a number.
step 1:
download files:
https://drive.google.com/file/d/1ULN_XcrbDkls2U2DlYkNM_yiua5h-_NI/view?pli=1
step 2:
Copy libbgi.a to the lib folder of Dev C++. The default location is C:\Program Files (x86)\Dev-Cpp\MinGW64\lib.
step 3:
Copy graphics.h and winbgim.h to the include folder of Dev C++. The default location is C:\Program Files (x86)\Dev-Cpp\MinGW64\include.
step4 :
Open Dev C++ and go to Tools -> Compiler Options. Select the Parameters tab and check the box for “Add the following commands when calling the linker”.
In the linker text area, paste the following commands:
-lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
. These are the required linkers for graphics.h file.
step 5:
#include<graphics.h>
#include<conio.h>
#include<stdio.h>
int main()
{
int gd = DETECT ,gm, i;
float x, y,dx,dy,steps;
int x0, x1, y0, y1;
initgraph(&gd, &gm, "C:\\TC\\BGI");
setbkcolor(WHITE);
x0 = 100 , y0 = 200, x1 = 500, y1 = 300;
dx = (float)(x1 - x0);
dy = (float)(y1 - y0);
if(dx>=dy)
{
steps = dx;
}
else
{
steps = dy;
}
dx = dx/steps;
dy = dy/steps;
x = x0;
y = y0;
i = 1;
while(i<= steps)
{
putpixel(x, y, RED);
x += dx;
y += dy;
i=i+1;
}
getch();
closegraph();
}
//ADVERTISEMENT
output>
1. Insert element at the front. -algorithm
2. Insert element at the end. -algorithm
3. Insert element at any position. -algorithm
4. Delete element from the front. -algorithm
5. Delete element from the end. -algorithm
6. Delete element from any position-algorithm
7. Count Node-Algorithm
8. Advantages And Disadvantages
9. Comapre with array
doubly link list
1. Insert element at the front. -algorithm
2. Insert element at the end. -algorithm
3. Insert element at any position. -algorithm
4. Delete element from the front. -algorithm
5. Delete element from the end. -algorithm
6. Delete element from any position-algorithm
7. Swap Two Adjacent Element-Algorithm
Circular Link List
1. Insert Element At The Front. -Algorithm
2. Insert Element At The End. -Algorithm
3. Insert Element At Any Position. -Algorithm
4. Delete Element From The Front. -Algorithm
5. Delete Element From The End. -Algorithm
6. Delete Element From Any
Position-Algorithm
Stack Using Link List-Algorithm
Queue Using Link List-Algorithm
Sparse Matrix Using Link List
Polynomial Using Link List
Polynomial Add, Subtract, Multiplication -Algorithm
1. Insertion,Deletion,Display Algorithm
2. Double Queue In A Single Array
3. Stack using queue
4.Queue using stack
Circular queue
1. Overflow Underflow Condition
2. Insertion, Deletion, Display Algorithm
Dqueue
1. Overflow Underflow Condition
2. Insertion, Deletion, Display Algorithm
Priority Queue
1. Definition,Example
2. Insertion, Deletion, Display Algorithm
1. push/pop/display/peek - algorithm
2. stack
Application
3.infix,prefix,postfix
4.infix to prefix -
algorithm
5.infix to postfix - algorithm
6.prefix evaluation- algorithm
7.postfix evaluation- algorithm
8.double stack in a single array- algorithm
1. Insert element at the front.-Algorithm
2. Insert element at the end.-Algorithm
3. Insert
element at any position.
4. Delete
element from the front.
5. Delete element from the end.
6. Delete element from any position
7.Address calculation
8.Advantages,Disadvantages
2D Array
1. Row major / Column major address calculation
Sparse matrix
Upper triangular/Lower triangular matrix
15.Sum of digits :—CLICK
16.
17. 1!+2!+3!+...n :—CLICK
18.1!-2!+3!-4!+...n :—CLICK
19. a+a²+a³+a⁴+a⁵... :—CLICK
20. a-a²+a³-a⁴... :—CLICK
21. (a/1)+(a²/2)+(a³/3)+(a⁴/4)+... :—
22. (a/1!)+(a²/2!)+(a³/3!)+(a⁴/4!)+... :—CLICK
23.a-(a²/2!)+(a³/3!)-(a⁴/4!)... :—CLICK
24. a+(a³/3!)+(a⁵/5!)+... :—CLICK
25. (a²/2!)+(a⁴/4!)+(a⁶/6!)+... :—CLICK
26. Sum of digits :—CLICK
27.
28. Armstrong number checking :—CLICK
29. Print all factors of a number :—CLICK
30.Count total number of factors :—CLICK
31.Prime number checking :—CLICK
32.Sum of all factors :—CLICK
33. Perfect number checking :— CLICK
34. Count total numbers of 0 in a number :—CLICK
35. Sum of all odd digits :—CLICK
36. Sum of all odd position and even position digits :—CLICK
37. Decimal to Binary :—CLICK
38. Binary to Decimal :—CLICK
39. Decimal to Octal :—CLICK
40. Octal to Decimal :—CLICK
41. Sum an average of n numbers :—CLICK
42. Program of a^b :—CLICK HERE
43. Input a number and check it is divisible by 3 or not :—CLICK
44. Input a number and check it is divisible by 3 or divisible by 5 or divisible by both or divisible by none :— CLICK
45. Input a salary and increament 10% salary :— CLICK
46. Pattern
“11111
22222
33333
44444”
45. Input a salary and increament 10% salary :—
#include<stdio.h>
int main()
{
int s,i,us;
printf("enter a salary ");
scanf("%d",&s);
i=s*10/100;
us=s+i;
printf("Updated salary=%d",us);
return 0;
}
44. Input a number and check it is divisible by 3 or divisible by 5 or divisible by both or divisible by none :—
#include<stdio.h>
int main()
{
int a;
printf("enter a value of n ");
scanf("%d",&a);
if(a%3==0)
{
if(a%5==0)
{
printf("%d is divisible by both",a);
}
else
{
printf("%d is divisible by 3 only",a);
}
}
else
{
if(a%5==0)
{
printf("%d is divisible by 5 only",a);
}
else
{
printf("%d is divisible by none of 5 and 3",a);
}
}
return 0;
}
43. Input a number and check it is divisible by 3 or not :—
#include<stdio.h>
int main()
{
int n;
printf("enter a value of n ");
scanf("%d",&n);
if(n%3==0)
{
printf("divisible by 3");
}
else
{
printf("not divisible by 3");
}
return 0;
}
42. Program of a^b :—
#include<stdio.h>
int main()
{
int a,b,f,i;
printf("enter a value and a power ");
scanf("%d%d",&a,&b);
f=1;
for(i=1;i<=b;i++)
{
f=f*a;
}
printf("%d",f);
return 0;
}
41. Sum an average of n numbers :—
#include<stdio.h>
int main()
{
int i,sum,n,k,m;
printf("enter a value of n ");
scanf("%d",&n);
sum=0;
for(i=1;i<=n;i++)
{
printf("enter a value ");
scanf("%d",&m);
sum=sum+m;
}
k=sum/n;
printf("%d %d",sum,k);
return 0;
}
40. Octal to Decimal :—
#include<stdio.h>
int main()
{
int i,sum,n,r;
printf("enter a value of n ");
scanf("%d",&n);
i=1;
sum=0;
while(n>0)
{
r=n%10;
sum=sum+i*r;
n=n/10;
i=i*8;
}
printf("%d",sum);
return 0;
}
39. Decimal to Octal :—
#include<stdio.h>
int main()
{
int i,sum,n,r;
printf("enter a value of n ");
scanf("%d",&n);
i=1;
sum=0;
while(n>0)
{
r=n%8;
sum=sum+i*r;
n=n/8;
i=i*10;
}
printf("%d",sum);
return 0;
}