Posts

C Program to Create Employee Record and Update it

    /*      * C Program to Create Employee Record and Update it      */     #include <stdio.h>     #include <stdlib.h>     #include <string.h>     #define size 200      struct emp     {         int id;         char *name;     }*emp1, *emp3;          void display();     void create();     void update();          FILE *fp, *fp1;     int count = 0;          void main(int argc, char **argv)     {         int i, n, ch;             printf("1] Create a Record\n");      ...

Program to sort numbers using counting sort and save the o/p in a file using FILE handling

/********************************************************************* * Program to sort numbers using counting sort and save * the o/p in a file using FILE handling **********************************************************************/ #include<stdio.h> #include<stdlib.h> #define MAXSIZE 500 void selection(int elements[], int maxsize); int elements[MAXSIZE],maxsize; void main() { int i; FILE *f; printf("\nHow many elements you want to sort: "); scanf("%d",&maxsize); printf("\nEnter the values one by one: "); for (i = 0; i < maxsize; i++) { printf ("\nEnter element %i :",i); scanf("%d",&elements[i]); } f=fopen("a.txt","w"); if(f==NULL) { printf("\nUnable to write in to the file\n"); exit(1); } //fprintf(f,"\nArray before sorting:\n"); //for (i = 0; i < maxsize; i++) //fprintf(f,"[%i], ",elements[i]); //fprintf (f,"\n"); selection(elements,maxsize); /...

Javascript Program

Image
 1) EVENT DRIVEN CLIENT SIDE SCRIPT. STEP 1 – EVENT.HTML <html> <head> <title> Event driven </title> </head> <body> <input type=”button” value=”Colors” OnMouseOver=window.setTimeout(“f1()”,1200);> <script language=”javaScript”> function f1() { document.bgColor=”orange”; window.setTimeout(“f2()”,1200); } function f2() { document.bgColor=”white”; window.setTimeout(“f3()”,1200); } function f3() { document.bgColor=”green”; window.setTimeout(“f4()”,1200); } function f4() { document.bgColor=”purple”; window.setTimeout(“f6()”,1200); } function f5() { document.bgColor=”cyan”; window.setTimeout(“f6()”,1200); } function f6() { document.bgColor=”brown”; window.setTimeout(“f7()”,1200); } function f7() { document.bgColor=”orange”; window.setTimeout(“f1()”,1200); f1(); } </script> </b...

Solved practical slips of 12th Computer Science journal

Image
Program 1:- Write a function in C++ that exchanges data (passing by references )using swap function to interchange the given two numbers.*/ # include<iostream.h> # include<conio.h> void swap(float &x ,float &y) { float t=x; x=y; y=t; } void main() { void swap(float &,float &); float a,b; cin>>a>>b; cout<<” a := ” << a <<” b := ”<< b<< endl; swap(a,b); cout<< ”a:= ”<< a<< ” b := ”<< b<< endl; } Output : 2 4 a := 2 b:= 4 a:= 4 b: =2   Program 2:- Write a program in C++ with a ratio class using member functions like assign () function to initialize its member data integer numerator and denominator ,convert() function to convert the ratio into double, invert() to get the inverse of the ratio and print() function to print the ratio and its reciprocal.*/ ...