Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Views: 1794

Replies to This Discussion

Complete Idea Soluton

Share the Assignment Questions & Discuss Here.... 

Stay touched with this discussion, Solution idea will be uploaded as soon as possible in replies here before the due date.

Share the Assignment Questions & Discuss Here.... 

Stay touched with this discussion, Solution idea will be uploaded as soon as possible in replies here before the due date.

cs508 assignment no 03 solution fall 2020

import java.io.*;
import java.math.*;
import java.util.scanner;

class TwistedPrimeNumber {
static int reverse(int num){
int rev = 0, remainder;
while(num > 0) {
remainder = num %10;
rev = rev * 10 +remainder;
num = num/10;
}
return rev;
}
static boolean isPrime(intnum) {
int flage = 0;
for (int i = num; i >= 1; i--){
if(num % i == 0){
flage += 1;
}
}
if(flage == 2) {
return true;
}
else{
return false;
}
}
static boolean isTwistedPrime (int num){
if(isPrime (num) == false){
return false;
}
else {
return isPrime(reverse (num));
}
}

public static void main(String args[]) {
scanner scan = new scanner (system.in);
String uid;
system.out.print("Enter Your Vu ID");
uid = scan.nextLine();
String id = uid.substrings(7,11);
stringBuilder rid = new stringBuilder(id);
rid.reverse() ;
int count = Integer.parseInt(rid.tostring());

for(int i = 2; i <= count; i++){
if(isTwistedPrime(i)) {
system.out.print(i + " ");

}
}

}
}

Twisted Prime Number Between (1 to id k last 4 digits reverse)
line is missing

the code is not running its shows errors

its not generating the output

CS508 Assignment 3 Solution Fall 2020

CS508 Assignment Solution # 3 Fall 2020- 21 ||Modern Programming Languages||

2 line miss hai is mn bhi :X

RSS

Looking For Something? Search Below

Top Trends 

Latest Activity

kashifali commented on + M.Tariq Malik's page Chit Chat Wall
1 hour ago
kashifali liked Momna Arshad's profile
1 hour ago
kashifali left a comment for Momna Arshad
1 hour ago
kashifali left a comment for jiya ali
1 hour ago
kashifali left a comment for jiya ali
1 hour ago
Golden Eye liked Black Bird Scientist's discussion graphic designer required
3 hours ago
Momna Arshad and +** KAKAR **+ are now friends
5 hours ago
+ "αяsαℓ " Ќąƶµяɨ •" replied to Sophie's discussion Reference letter
14 hours ago

VIP Member Badge & Others

How to Get This Badge at Your Profile DP

------------------------------------

Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service