My First Java Program: Print a Message “Hello World”
class HelloWorld { public static void main(String…s) { System.out.println(“Hello World”); } }
class HelloWorld { public static void main(String…s) { System.out.println(“Hello World”); } }
#include<stdio.h> #include<conio.h> void main() { int fac,n; int factorial(int); clrscr(); printf(“Enter any number:”); scanf(“%d”,&n); fac=factorial(n); printf(“Factorial=%d”,fac); getch(); } int factorial(int x) { int f; if(x==1||x==0) return 1; else f=x*factorial(x-1); return f; }
Here you will get C program to find lcm and hcf of two given numbers. #include<stdio.h> int main() { int a,b,hcf,lcm,max,min,r; printf(“Enter two numbers:”); scanf(“%d%d”,&a,&b); if(a>b) { max=a; min=b; } else if(b>a) { max=b; min=a; } if(a==b) hcf=a; else { do { r=max%min; max=min; min=r; }while(r!=0); hcf=max; } lcm=(a*b)/hcf; printf(“\nLCM=%d\nHCF=%d”,lcm,hcf); return 0; } Output …
Are you thinking to create a game? If yes, then you may need to move and control an object using arrow keys. For example, if you are going to create pacman game. In that case you have to control the pacman with the help of arrow keys. In this tutorial I will tell you the …
How to Move and Control an Object Using Arrow Keys in C/C++? Read More »
#include<stdio.h> #include<conio.h> struct date { int day; int month; int year; }; void main() { struct date d1,d2; clrscr(); printf(“Enter first date(dd/mm/yyyy):”); scanf(“%d%d%d”,&d1.day,&d1.month,&d1.year); printf(“nEnter second date(dd/mm/yyyy):”); scanf(“%d%d%d”,&d2.day,&d2.month,&d2.year); if((d1.day==d2.day)&&(d1.month==d2.month)&&(d1.year==d2.year)) printf(“nEQUAL”); else printf(“nUNEQUAL”); getch(); }
#include<stdio.h> #include<conio.h> struct sum { int a; int b; }; void main() { int sum1; struct sum s; clrscr(); printf(“Enter two numbers:”); scanf(“%d%d”,&s.a,&s.b); sum1=s.a+s.b; printf(“nSum=%d”,sum1); getch(); }
Whatsapp for java phones is like a dream for java mobile users. I found a solution for this and in this article, I am going to tell you how to download and install Whatsapp for java phones.WhatsApp is an app used to send free SMS to your friend who is also using the app via …
Whatsapp for Java Phones – How to Download and Install Read More »
It goes without saying that JavaScript is an impressive and mind boggling client side scripting language, available with the present generation web developers to design and develop websites which are feature rich and quite scalable. However, we have seen that it takes a certain amount of skill and expertise to master the web development environment …
6 Tools to make JavaScript Development a Cakewalk Read More »