Posts
#include <stdio.h> #include <math.h> void main() { int z =(power(3,7)); printf("%d",z); } int power(int x,int n) { int y=x; if(n==0) return 1; else if (n==1) return x; else if(n>1) { while(n>1) { x=x*y; n--; } } return x ; } OUTPUT : 2187
Write a program in Java to input in numbers and find out the smallest and the largest number also display the average number
- Get link
- Other Apps
By
anuj batham
-
import java.io.*; import java.lang.*; import java.util.Scanner; public class Main { static int[]args; public static void main (String[]arg) { Main ob=new Main(); args=new int[10]; int avg=0; Scanner sc =new Scanner(System.in); for (int i = 0; i < 10; i++) { args[i]= sc.nextInt(); avg+=args[i]; } ob.calculate(); System.out.println("Average ="+ avg/10); } void calculate() { int tmp=0,i; for ( i = 0; i < 10; i++) { for(int j=0;j<args.length-1;j++) { if(args[j]>args[j+1]) { tmp=args[j]; args[j]=args[j+1]; args[j+1]=tmp; } } } System.out.println("Max="+args[args.length-1
Java program to take 10 cities name in an array and display which starts with consonant
- Get link
- Other Apps
By
anuj batham
-
import java.io.*; import java.lang.*; public class Main { public static void main (String[]args) { for (int i = 0; i < args.length; i++) { switch (args[i].charAt (0)) { case 'a': case 'e': case 'i': case 'o': case 'u': case 'A': case 'E': case 'I': case 'O': case 'U': break; default: { System.out.println (args[i]); break; } } } } }
Freelancer 20 million lives changing video
- Get link
- Other Apps
By
anuj batham
-
- Get link
- Other Apps
By
Manoj Kumar Shukla
-
Hi all We are glad to inform you that we are now offering BCA , MCA , B.Tech, M.Tech final year projects at a very reasonable prices on each type and on every technology including PHP, asp.NET, C#, android. if you need any don't hesitate to mail us................. you can also contact us on these given mails... manojshukla1466@gmail.com vina23y@gmail.ocm arjunshukla1466@gmail.com brightfuture1466@gmail.com