Posts

Write a function int power (int x, int n) to return x^n without using pow function

#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

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

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;                             }                           }             }     } }

JSE coin

Cryptocurrencies are subject to risk.Invest at your own risk. Jse coin  Java script embedded coin One of the automatic minning currencies. You can join it . https://platform.jsecoin.com/?lander=2&utm_source=referral&utm_campaign=aff53832&utm_content=

Freelancer 20 million lives changing video

Image
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

HAPPY CHILDREN'S DAY

HAPPY CHILDREN'S DAY