# Persistent Coding Questions 2020 | Persistent Technical Interview Questions 2020

20790

#### Persistent Systems Coding Questions 2020 | Persistent Technical Interview Questions 2020

In this article you will get all the Persistent Systems Coding Questions 2020 And Persistent Technical Interview Questions 2020, which will help you in attending Persistent Systems Coding Exam

Persistent Systems Careers: Persistent Systems is a technology services company which was incorporated on 16 May 1990 as Persistent Systems Private Limited. It was subsequently converted into a public Limited company on 17 September 2010 with the name Persistent Systems Limited and a new certificate of incorporation was issued on 28 September 2007 from the RoC

Company: Persistent Systems

Website: Persistent Systems

Wikipedia: Persistent Wiki

Job Profile: Software Engineer

Degree Needed: B.E/B.Tech

Passout Year: 2019/2020

Work Location: Pune, Nagpur, Bangalore, Goa and Hyderabad

Package: 4.51 LPA

Experience Level: 0 – 1 Years

Jobs By Location And Passout Year:

 Pune Hyderabad Delhi Mumbai Coimbatore Noida Bangalore Chennai Off Campus Nagpur Gurgaon Walk In 2015 Batch 2018 Batch 2021 Batch 2016 Batch 2019 Batch 2022 Batch 2017 Batch 2020 Batch 2023 Batch

Persistent Coding Questions 2020

1. Program to find the GCD or HCF of two numbers

Program:

include
include
int main()
{
int a,b,gcd;
printf(“\nEnter two numbers : “);
scanf(“%d %d”,&a,&b);
int i;
for(i = 1; i <= a && i <= b; i++)
{
if((a % i == 0) && (b % i == 0))
{
gcd = i;
}
}
printf(“\nGCD of %d and %d is %d “,a,b,gcd);
printf(“\n”);
return 0;
}

Output:

Input- Enter two numbers:20 28 Output- GCD of 4

2. Program to Check whether a given number is a prime or not

Program:

#include<stdio.h>
int main()
{ int n,i;
printf(“\nEnter the number : “);
scanf(“%d”,&n);
for(i = 2; i <= n/2; i++)
{
if(n % i ==0)
{ break; }
}
if(i > n/2)
printf(“\n%d is a Prime Number\n”,n);
else
printf(“\n%d is not a Prime Number\n”, n);
return 0;
}

3. Program to check whether the number is Armstrong or not

Program:

include
include
int main()
{
int number, temp, remainder, result = 0, n = 0 ;
printf(“Enter an integer: “);
scanf(“%d”, &number);
temp = number;
while (temp != 0)
{
temp /= 10;
++n;
}
temp = number;
while (temp != 0)
{
remainder = temp%10;
result += pow(remainder, n);
temp /= 10;
}
if(result == number)
printf(“%d is an Armstrong number\n”, number);
else
printf(“%d is not an Armstrong number\n”, number);
return 0;
}

4. Program to convert a number from decimal to binary using for loop

Program:

include
long int decimal_to_binary(int n)
{
long int binary = 0;
int remainder, i, flag = 1;
for(i = 1; n != 0; i = i * 10)
{
remainder = n % 2;
n /= 2;
binary += remainder * i;
}
return binary;
}
int main()
{
int n;
printf(“Enter a decimal number: “);
scanf(“%d”, &n);
printf(“Equivalent binary number: %d\n”, decimal_to_binary(n));
return 0;
}

Output:

Input- Enter a decimal number:255
Output- Equivalent binary number: 11111111

5. Program to Reverse a Number in C

Program:

include
int main()
{
int n, rev = 0, rem;
printf(“\nEnter a number : “);
scanf(“%d”, &n);
printf(“\nReversed Number : “);
while(n != 0)
{
rem = n%10;
rev = rev*10 + rem;
n /= 10;
}
printf(“%d\n”, rev);
return 0;
}

Output:

Enter a number : 12345
Reversed Number : 54321

6. Program to remove vowels from a string

Program:

include
int check_vowel(char);
int main()
{
char s, t;
int c, d = 0;
gets(s);
for(c = 0; s[c] != ‘\0’; c++)
{
if(check_vowel(s[c]) == 0)
{
t[d] = s[c];
d++;
}
}
t[d] = ‘\0’;
strcpy(s, t);
printf(“%s\n”, s);
return 0;
}
int check_vowel(char ch)
{
if (ch == ‘a’ || ch == ‘A’ || ch == ‘e’ || ch == ‘E’ || ch == ‘i’ || ch == ‘I’ || ch ==’o’ || ch==’O’ || ch == ‘u’ || ch == ‘U’)
return 1;
else
return 0;
}

Output:

Input- qwertyuiop Output- qwrtyp

7. Program to convert a number from binary to octal

Program:

include
include
int binary_to_octal(long int binary)
{
int octal = 0, decimal = 0, i = 0;
while(binary != 0)
{
decimal += (binary%10) * pow(2,i);
++i;
binary/=10;
}
i = 1;
while (decimal != 0)
{
octal += (decimal % 8) * i;
decimal /= 8;
i *= 10;
}
return octal;
}
int main()
{
long int binary;
printf(“\nEnter a binary number: “);
scanf(“%lld”, &binary);
printf(“\nOctal Equivalent : %d\n”, binary_to_octal(binary));
return 0;
}

Output:

Input- Enter a binary number:1111 Output- Octal Equivalent :17

If you haven’t register for Persistent Drive 2020 then you can get register from here

If You Want To Get More Daily Such Jobs Updates Then Press Red Bell Icon At The Right Side of Page To Subscribe our Updates.

Top 5 High Salary Jobs in India IT Sector 2020: Click here

Cognizant Latest News: Up To 20K+ Employees Will Be Hired: Click here

Jio vs Airtel vs Vodafone- Idea 2 Gb Per Day Data Plan Comparison: Click here