Program List to build logic


 Swift Program List, Check your swift Program Logic, Check Your String Logic

Basic Program

WAP to calculate the difference of two dates in the year, a date should be assigned on DDMMYYYY 



o/p  2019-2016  3

WAP to calculate the sum of all digits in date of birth?

WAP to Convert feet to inch and inch to feet?

WAP to convert km to meter?

WAP to convert decimal to binary?

WAP to calculate basic, ta, da, comm, pf,  HRA, Leave, number of leave will be entered by the users?

WAP to display the middle number is a three-digit number?  a 145,154,451   

WAP to calculate Square and Cube of any assigned number?

WAP to calculate electricity bill where unit price, total consumption, the extra load will be entered by the users?

WAP to calculate Simple Interest where rate and time will be constant and the principal will be an integer?

WAP to calculate the area of a triangle, circle, and rectangle in the same program where the value of pi, the base of the triangle, and the height of the rectangle will be constant.

 WAP to convert temperature from  Celsius to Fahrenheit?

Program assignment:-

WAP to calculate the salary of the employee where basic, ta, da, comm, pf, noofleave will be entered by the user?

WAP to calculate compound interest?    *

WAP to reverse the five-digit number where the first and last digit will be in the same position

WAP to swap two numbers without using a third variable

WAP to calculate square and cube of any entered number?

Ternary Operator Based Program:-

Assignment of Ternary Operator:-

1) WAP to check leap year using a ternary operator in Python?

2)  WAP to check divisibility of number that it is divisible by 3 and 5 or not?


3)  WAP to check divisibility of a number by 3 and 5, individually and both?

4)  WAP to check that salary is in income tax or not display the total amount and the taxable amount 

5)  WAP to calculate electricity bill where unit price, total consumption will be entered by the user if the bill is <400 then pay only 100 RS and above this 50% amount will be paid.


Q) WAP to increase the salary of employees from 500 if entered salary will be less than 10000 otherwise the same salaries will be displayed.

Q) WAP to display the subject mark of the student which will be entered by the user's if the entered subject mark is eligible for grace then display mark including grace mark otherwise actual mark will display.

1)  WAP to increase the Salary of an employee from 500 if the entered salary is less than 10000 otherwise increase by 800?

2) WAP to Check Leap Year? 

3) WAP to check number is positive or negative?

Q WAP to display "YES" and "NO" when the user press 'y' and 'n'?



WAP to check greatest using four different numbers?

WAP to check that entered number is one digit negative number or a positive number?

Q WAP to check divisibility of number from 3,5 and 9 with all combination?

WAP to check that entered input is numeric char or alphabet char?

Q WAP to display "YES" and "NO" when the user press 'y' and 'n'?

Q WAP to check the middle number in a three-digit number?

Q) WAP to check that entered char is vowel and consonant without using or operator?

Q) WAP to Calculate Marksheet using five different subjects with the following condition.

1) all subject marks should be 0 to 100.

2) if only one subject mark is <33 then the student will be suppl.

3) if all subject marks are >=33 then percentage and division should be calculated.

4) if a student is suppl then five bonus marks can be applied to be pass and the result will be "pass by grace".

5) Display Grace Subject name, distinction subject name,suppl subject name, and failed subject name.

Switch Program List:-

WAP to check even|odd using switch?

WAP to check the greater number using Switch?

Q)WAP to display "yes", "no" and "cancel" when user assign 'y','n', and 'c'?

Q) WAP to check leap year using a switch?

Q) WAP  to check entered char is numeric, alphabets, or special using switch? 

While Loop Program:-

WAP to display the table of numbers?

WAP to display fibonacci series?

WAP to calculate Factorial?

WAP to reverse any digit number?

Array-Based Program In Swift:-

1) WAP to sort the elements of the array in ascending order?

2)  WAP to find the max and second max element in an array?

3)  WAP to merge two arrays in one array?

4)  WAP to display duplicate elements in an array?

5) WAP to display unique elements in an array?

2 3 4 5 7 11 11 2 5    o/p   3 4 7

6) WAP to display prime elements in the array?

7)  WAP to find max and second max char in String?
     String s = "hello";   output o is the max char and l is the second max
8)  WAP to find second max prime elements in the array?

9)   WAP to sort only odd elements in an array?

      12 21 34 56 67 89 3 88 7

  o/p    12 3  34 56 7  21 67 88

Array Most Important Program for Interview Purpose

Check if a key is present in every segment of size k in an array

Find the minimum and maximum element in an array

Write a program to reverse the array

Write a program to sort the given array

Find the Kth largest and Kth smallest number in an array

Find the occurrence of an integer in the array

Sort the array of 0s, 1s, and 2s

Range and Coefficient of array

Move all the negative elements to one side of the array

Find the Union and Intersection of the two sorted arrays

Level 2
Write a program to cyclically rotate an array by one

Find the missing integer

Count Pairs with given sum

Find duplicates in an array

Sort an Array using the Quicksort algorithm

Find common elements in three sorted arrays

Find the first repeating element in an array of integers

Find the first non-repeating element in a given array of integers

Find the largest three elements in an array Time

Rearrange the array in alternating positive and negative items

Find if there is any subarray with sum equal to zero

Find Largest sum contiguous Subarray

Find the factorial of a large number

Find Maximum Product Subarray

Find longest consecutive subsequence

Find the minimum element in a rotated and sorted array

Find all elements that appear more than N/K times

GCD of given index ranges in an array

Minimize the maximum difference between the heights

Minimum number of jumps to reach the end

Find the two repetitive elements in a given array

Find a triplet that sums to a given value

Construct a N*M matrix from the user input

Find the row with the maximum number of 1’s

Print the matrix in a Spiral manner

Find whether an array is a subset of another array

Implement two Stacks in an array

Majority Element

Wave Array

Trapping Rainwater

Level 3
Maximum Index

Max sum path in two arrays

Find Missing And Repeating

Stock buy and sell Problem

Pair with given sum in a sorted array

Chocolate Distribution Problem

Longest Consecutive Subsequence

Print all possible combinations of r elements in a given array

String-based Program

1) Count total vowel and consonant in String?

2)  WAP to reverse String?

3)  Convert upper case to lower case?

4)   Count total numeric char in String?

5) WAP to convert string elements in the opposite case?

6) WAP to validate email?

7) WAP to validate internet URL it can be HTTP, HTTP, and without HTTP?

8) WAP to check password strength, if it contains consecutive char, without any 3 special char, their name or last name then the password will be weak, if the password contains 3 special char, nonconductive char then the password will be strong?

5) WAP to display the largest palindromic in a string?

6) WAP to find total prepositions in a paragraph

Post a Comment


POST Answer of Questions and ASK to Doubt

Post a Comment (0)