Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript

#include<stdio.h>
#include<conio.h>
void main()
{
	char choise;

	char hel;

	int p,k,g;

	int b,c,e;

	printf("
 Welcome to GM Program :) 

 It's a one time usalbe program so you can start the program again and again");
	printf("

 Type 't' for Tables");
	printf("

 Type 'h' for ASMD is Add,Sub,Mul,Div");
	printf("

 Enter :- ");
	scanf("%c",&choise);

	switch(choise)
	{
		case 't':
		printf("

 Enter a number to make the table :- ");
		scanf("%d",&p);
		for(k=1;k<11;k++)
		{
			g=p*k;
			printf("

 %dx%d=%d",p,k,g);
		}
		break;
		case 'h':
		printf("

 Type 'a' for add 

 Type 's' for sub 

 Type 'm' for mul 

 Type 'd' for div");
		printf("

 Enter :- ");
		scanf("%s",&hel);
		switch(hel)
		{
			case 'a':
			printf("

 Enter two number to add :- ");
			scanf("%d%d",&b,&c);
			e=b+c;
			printf("

 Your answer :- %d+%d=%d",b,c,e);
			break;
			case 's':
			printf("

 Enter two number to sub :- ");
			scanf("%d%d",&b,&c);
			e=b-c;
			printf("

 Your answer :- %d-%d=%d",b,c,e);
			break;
			case 'm':
			printf("

 Enter two number to mul :- ");
			scanf("%d%d",&b,&c);
			e=b*c;
			printf("

 Your answer :- %dx%d=%d",b,c,e);
			break;
			case 'd':
			printf("

 Enter two number to div :- ");
			scanf("%d%d",&b,&c);
			e=b/c;
			printf("

 Your answer :- %d/%d=%d",b,c,e);
			break;
	   }
	}
	getch();
	return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #JavaScript
ADD COMMENT
Topic
Name
5+8 =