Skip to main content

Posts

Showing posts from June, 2017

Determine whether a given number can be expressed as sum of two prime numbers or not

/* Write a program to determine whether a given number can be expressed as sum of two prime numbers or not. For example 34 can be expressed as sum of two prime numbers but 23 cannot be. */ import java.util.*; import java.io.*; public class SumOfTwoPrime { public static void Primer(int num) { ArrayList<Integer> ar = new ArrayList<Integer>(); boolean flag=false; int prevPrime = 1; for(int i=1;i<=num;i++) { for(int j=2;j<i;j++) { if(i%j==0) { flag=false; break; } else flag=true; } if(flag==true) { ar.add(i); } } for(int i=0;i<ar.size();i++) { for(int j=0;j<ar.size();j++) { if( (ar.get(i))+(ar.get(j)) == num ) System.out.println(num+" is sum of two primes "+ar.get(i)+" and "+ar.get(j)); } } }   public static void main(String args[]) {   Scanner sc = new Scanner(System.in);   int n = sc.nextInt();   Primer(n);   } }

Given a string, reverse only vowels in it; leaving rest of the string as it is

/* Given a string, reverse only vowels in it; leaving rest of the string as it is. Input : abcdef Output : ebcdaf */ import java.io.*; import java.util.*; public class VowelReverse { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); String vowels = ""; String ans = ""; int arr[] = new int[str.length()]; for(int i=0;i<str.length();i++) { if(str.charAt(i)=='a' || str.charAt(i)=='e' || str.charAt(i)=='i' || str.charAt(i)=='o' || str.charAt(i)=='u') { vowels+=str.charAt(i); arr[i]=1; } } String revVowels = new StringBuffer(vowels).reverse().toString(); int j=0; for(int i=0;i<str.length();i++) { if(arr[i]!=1) { ans+=str.charAt(i); } else { ans+=revVowels.charAt(j); j++; } } System.out.println(ans); } }

Making android apps easily within minutes

Hiii, I haven't been here for a while, after a long time i'm visiting my own blog 😀. Scan this QR code to download the app It has been changed a lot. Peoples are moving towards video blogs. Some peoples really don't have time to read a blogs. But I was really enjoyed writing since I started to blog. And I would like to share a lot with you friends. I will try to post at least one post per week 😂. I changed my blog name from mani-g to techfuu . And let's hope the numerology will help us to post frequently. 😇 Today we are going to see one amazing site that can help us to make our site content into an Android app. Interesting isn't. Within a few minutes we can get our android app ready to be published in google playstore. visit:  appsgeyser.com link to the app: http://app.appsgeyser.com/5083322/Tech%20fu register there and give your site url. Within few minutes it will send the apk with source code to our mail. To publish our app to google pla