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;
}
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")