Saturday, November 9, 2024

POINTER

 

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;

}

POINTER

 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;

}

POINTER

 

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;

}

POINTER

 

 

int main()

{

    int a[]={10,20,30,40};

    int *p;

    p=a;

    printf("%d",*a);

   

    return 0;

}

static variable

 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;

}

c question on pointer

 

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;

}


Sunday, November 3, 2024

INTERNET TECHNOLOGY - JAVASCRIPT

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()


Thursday, August 29, 2024

Sum and Product of digits in a number

 # 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

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

Perfect Number by using For_loop

 # 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(&quot;Number is a Perfect Number.&quot;)

else:

    print(&quot;Number is not a Perfect Number.&quot;)