Get URL Parameters With JavaScript

java script url parameter

Get URL Parameters With JavaScript The JavaScript function below parses and returns the parameters. function getUrlVars() { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { vars[key] = value; }); return vars; } Then is how you can pick a value from the url parameter. var number = getUrlVars()[“x”]; var mytext = getUrlVars()[“text”]; The … Read more

C program to print happy holi

c program to sort array

C program to print happy holi Here is the simple program written in c to Print Happy Holi.   #include<stdio.h> #include<conio.h> void main() { printf(“HAPPY HOLI “); getch(); }    

Pascal trangle program in c

Pascal trangle program in c Pascal Triangle is a Triangle form which, each number is the sum of immediate top row near by numbers. The Value of edge is always 1. 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 Let’s Start C program:   #include <stdio.h> int main() … Read more

Linear search program in c

c program to sort array

Linear search program in c   #include <stdio.h> int main() { int array[100], search, c, n; printf(“Enter number of elements in array\n”); scanf(“%d”, &n); printf(“Enter %d integer(s)\n”, n); for (c = 0; c < n; c++) scanf(“%d”, &array[c]); printf(“Enter a number to search\n”); scanf(“%d”, &search); for (c = 0; c < n; c++) { if … Read more

Sorting program in c

c program to sort array

Sorting program in c /* * C program to accept N numbers and arrange them in an ascending order */ #include <stdio.h> void main() { int i, j, a, n, number[30]; printf(“Enter the value of N \n”); scanf(“%d”, &n); printf(“Enter the numbers \n”); for (i = 0; i < n; ++i) scanf(“%d”, &number[i]); for (i … Read more

Write a program to convert temperature Fahrenheit to Centigrade

temperature Fahrenheit to Centigrade degrees c program

Write a program to convert temperature Fahrenheit to Centigrade Input temperature in fahrenheit from user. Store it in some variable say fahrenheit. Apply the temperature conversion formula celsius = (fahrenheit – 32) * 5 / 9. Print the value of celsius. Example Input Temperature in fahrenheit = 205 Output Temperature in celsius = 96.11 C Temperature conversion formula … Read more

C program to reverse words in a string

c program reverse-words-in-string

C program to reverse words in a string This profram will invert each word occurring in the input string. Algorithm is very simple just scan the string and keep on storing characters until a space comes. If a space is found then we have found one word so we append null terminator and then reverse the … Read more

C program to draw circles in circles

C program to draw circles in circles

C program to draw circles in circles #include<graphics.h> #include<conio.h> #include<dos.h> main() { int gd = DETECT, gm, x, y, color, angle = 0; struct arccoordstype a, b; initgraph(&gd, &gm, “C:\\TC\\BGI”); delay(2000); while(angle<=360) { setcolor(BLACK); arc(getmaxx()/2,getmaxy()/2,angle,angle+2,100); setcolor(RED); getarccoords(&a); circle(a.xstart,a.ystart,25); setcolor(BLACK); arc(getmaxx()/2,getmaxy()/2,angle,angle+2,150); getarccoords(&a); setcolor(GREEN); circle(a.xstart,a.ystart,25); angle = angle+5; delay(50); } getch(); closegraph(); return 0; }  

traffic light program in c

traffic program in c

Traffic light program in c #include<graphics.h> #include<conio.h> #include<dos.h> #include<stdlib.h> main() { int gd = DETECT, gm, midx, midy; initgraph(&gd, &gm, “C:\\TC\\BGI”); midx = getmaxx()/2; midy = getmaxy()/2; setcolor(RED); settextstyle(SCRIPT_FONT, HORIZ_DIR, 3); settextjustify(CENTER_TEXT, CENTER_TEXT); outtextxy(midx, midy-10, “Traffic Light Simulation”); outtextxy(midx, midy+10, “Press any key to start”); getch(); cleardevice(); setcolor(WHITE); settextstyle(DEFAULT_FONT, HORIZ_DIR, 1); rectangle(midx-30,midy-80,midx+30,midy+80); circle(midx, midy-50, 22); … Read more