Posts

Showing posts from January, 2022

Arrow Functions in Javascript

  < html > < head >   < title > Arrow functions </ title >   < script >       var fun = function (){           return "Hello Compuhelp" ;       } //end of function       function test ( f )       {             return f ();       }             function useArrow ()       {         // div1.innerHTML= div1.innerHTML +  fun();         //div1.innerHTML= div1.innerHTML+ test(fun);         const x =( nm ) => "I am arrow function" + nm ;         head3 . innerHTML = x ( "compu" );         //return "hello compu";       }         </ script > </ head > < body > < div id = "div1" > < h2 id = "head2" > Use ...

Java Script Classes

  <! DOCTYPE html > < html lang = "en" > < head >     < title > javascript classes </ title >     < script >         class GMaths         {           constructor ()             {                 this . num1 = 100 ;                 this . num2 = 20 ;             }             /* constructor(n1,n2)             {                 this.num1=n1;                 this.num2=n2;             }*/             setData ( n1 , n2 )             {                 this . num1 ...

First Object Oriented CPP Program

 //my first object oriented cpp program #include<iostream> using namespace std; int x;//variable class Maths {     int num1;//Data member     int num2;     int res;     public:    void getData()//member function     {     cout<<"Enter first number";     cin>>num1;     cout<<"\n Enter second number";     cin>>num2;     }//end of function getData     //num1=10;     //num2=20;     void sum()     {     res=num1+num2;     cout<<"\n The sum of "<<num1<<" and "<<num2<<" is: "<<res;     }//end of function sum }; int main()//non member funtion {     Maths mt;     mt.getData();     mt.sum(); }//end of main

Using Functions in JavaScript

  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta http-equiv = "X-UA-Compatible" content = "IE=edge" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > use of functions </ title >         < script >     var arr =[ 10 , 20 , 30 ];             function displayValue ( curObj )         {             // alert(value);             curObj . value = "new Text" ;             ans = sum ( 10 , 20 );             alert ( "The value of ans is " + ans );             addValues ( arr );         }         function sum ( n1 , n2 )     ...

Copy text character by character

Image
  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta http-equiv = "X-UA-Compatible" content = "IE=edge" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > copy char by char </ title >     < script >         var ctr = 0 ;         function copyText ()         {             var arr = text1 . value ;             text2 . value = text2 . value + arr [ ctr ];             ctr ++;             if ( ctr > text1 . value . length )             {                 ctr = 0 ;                 text2 . value = "" ; ...

ftell() function in C Programming Language

Image
 //use of ftell() function in c ftell() function is used to return the position of the pointer in file. #include<stdio.h> void main() {     FILE *fptr;     int pos;     fptr=fopen("C:\\students\\batch8am-9am\\test.txt","w+");     if(fptr!=NULL)     {         fprintf(fptr,"hello");         pos=ftell(fptr);         printf("\n pointer location is %d",pos);         fprintf(fptr," vani");         pos=ftell(fptr);         printf("\n pointer location is %d",pos);         fclose(fptr);     } }//end of main Output of the program is :

Job Placement Training Package for B. Tech. Computer Science Students :

  During your B. Tech. Computer Science Stream, you have to study number of subjects. You must study all the subjects with full understanding during College time. We don't understand the importance of the subjects which are taught during the B. Tech.  But at the end of the degree we start to realize the importance of all the subjects. Some of the Technologies which are mostly required by the IT Industry to hire the B. Tech. Students are as following: >>Fundamentals of Programming Using C. >>Object Oriented Programming Concepts Using C++.  >>Programming Language JAVA. >>Understanding of Data Structures and Algorithms. >>Database Concepts and SQL. >>Web Technologies Client Side : HTML, CSS, Java Script >>Web Technologies Server Side: Python etc. >>Project using all the Technologies. >>English as communication language. At COMPUHELP We are providing the Job Placement Training for B. Tech Com...

How to Understand Programming and Learn Better ?

READ WITH IMAGINATION  OR NOT : There is nothing Possible without Programming in our real life. So you do programming everyday every moment of your day to day life. Programming is the way how you do your day to day jobs in efficient way. It must be efficient.  We do each and everything in our real life through brain programming. Think and imagine every word of your Teacher or any source of learning. Behave as compiler, translate your code as compiler on paper. Do not lie to your instructor at least during your learning times. Try to know the behavior of the machine you want to instruct or program. If you don't understand keep doing practice with attentive brain or with compiler brain. If Programming is your passion, that is very good, if not, make it passion, if not, quit.  Some times Passion serves needs of life and some times needs make your passion. Any how work or job must be your passion, or passion must be your work. If you are B. Tech. Student, be student during st...

Use of getch(),getche() and getchar() functions in C

Use of getch(),getche(),getchar() functions in C void main() { char ch; printf("Please enter a character:"); ch=getch(); printf("\n\nEntered character is %c\n\n",ch); printf("\n Please enter a character :"); ch=getche(); printf("\n\nEntered character is %c",ch); printf("\nPlease enter a character and press enter key :"); ch=getchar(); printf("\n Entered character is %c",ch); }//end of main function

Use of grids in web page to make partitions

Use of grids in web page to make partitions   < html > < head > < title >practice html webpage</ title > < style > .container3 {       background-color : brown ;         display : grid ;         grid-template-columns : 33 % 33 % 33 % ;         margin : 10 px ;         padding : 10 px ; } /*end of style block*/ .container2 { background-color : blueviolet ;         display : grid ;         grid-template-columns : 70 % 30 % ;         margin : 10 px ;         padding : 10 px ; } .container6 {         display : grid ;         grid-template-columns : auto auto auto ;         grid-gap : 5 px ; } .grid-items {         background-color : rgb ( 25 , 26 , 25 );         color : whitesmoke ...

How to Add Elements to the web page at run time?

How to Add Elements to the web page at run time?   < html >     < head >         < title >Testing</ title >         < script >             function addElement ()             {                 x = document. getElementById ( "mybody" );                 node = document. createElement ( "h1" );                 node.innerHTML = "this is new heading one" ;                 x. appendChild (node);                             }             var ctr = 0 ;             function addButton ()             {           ...

/*Write a C program that reads N integer numbers and arrange them in ascending order using Bubble sort*/

 /*Write a C program that reads N integer numbers and arrange them in ascending order using  Bubble sort*/ #include<stdio.h> int main() {     int arr[50],i,j,n,temp;     printf("Enter How many integers you want to arrange ?");     scanf("%d",&n);     for(i=0;i<n;i++)     {         scanf("%d",&arr[i]);     }     printf("\n Elements of the array are :\n\n");     for(i=0;i<n;i++)     {         printf(" %d",arr[i]);     }     for(i=0;i<n;i++)     {         for(j=i+1;j<n;j++)         {             if(arr[i]>arr[j])             {                 temp=arr[i];                 arr[i]=arr[j];         ...

Code to display images in JS and change images dynamically.

Code to display images in JS and change images dynamically.   <html>     <head>         <title></title>         <script>             var ctr= 0 ;             function changeImage()             {                 var x=document.getElementById( "myimage1" );                 if (ctr== 0 )                 {                 x.src= "image2.jpg" ;                 ctr= 1 ;                 }                 else                 {                     x.src= "i...

COMPUHELP Makes Easy to Understand JS Java Script Test Your Skills :

COMPU HELP Makes Easy to Understand JS Java Script Test Your Skills : Question no 1: Who has developed Javascript and in which year it is developed? Question no 2: Which is the current version of the Javascript ? Question no 3: What is the role of Javascript in web page? Question no 4: How we can add Javascript in our web page? Question no 5 : Write Javascript to add two numbers and display the sum. Question no 6: Write Javascript to  divide two numbers and display the quotient. Question no 7: Write Javascript to divide two numbers and display the remainder. Question no 8: Write Javascript to find the square of number 5 and display the result. Question no 9: Write Javascript to multiply four numbers and display the result. Question no 10: Write Javascript to add the first two numbers and then subtract the third number and display the result. (num1=10,num2=5,num3=6) COMPU HELP Makes Easy to Understand JS Java Script Test Your Skills : Question no 1:   Who has devel...

Using Two Dimensional Character Array

  Using Two Dimensional Character Array #include<stdio.h> void main() {   char wdays[7][10],row;   for(row=0;row<7;row++)   {   printf("Enter week days ;");   scanf("%s",wdays[row]);   }   printf("\n Week days are :\n\n");   for(row=0;row<7;row++)   {       printf("\n%s\n",wdays[row]);   } }//end of main

Display elements of Two Dimensional array through pointer

  Display elements of Two Dimensional  array through pointer #include<stdio.h> void main() {     int arr[2][3],row,col,i,*ptr;     for(row=0;row<2;row++)     {         printf("\n Enter values of row %d ",row+1);         for(col=0;col<3;col++)         {             scanf("%d",&arr[row][col]);         }     }//end of outer loop     ptr=arr;     printf("\n Elements of array are :");     for(i=0;i<=5;i++)     {         printf("%d ",ptr[i]);         //ptr++;     }    printf("\n\n Elements of array using pointer are: \n\n");     for(i=1;i<=6;i++)     {         printf("%d ",*ptr);         ptr++;     } }//end of main