Programming Questions
1)WAP to sort N Elements in Ascending Order and remaining elements in Descending Order?
Input :11 7 5 10 46 23 16 8
Ouptut: 5 7 11 46 23 16 10 8(If User Entered 'n' as 3)
2)WAP to Count the same positions if the String is reverse and Compare with Original String?
Input :alphxxdida
Output : 4
3)WAP for Data Encoder Application
Input :"Abbcddd eef ghhhijjj aabbc, omg"
Output :1A2b1c3d 2e1f 1g3h1i3j 2a2b1c1, 1o1m1g
4)WAP to check given string is a valid IPV4 address (or) not.If it is valid display true otherwise false.
Input : 192.168.1.1
Ouput : True
5)WAP to check the permutation of given string and print the ouptut?
Input :abc
Output :abc,bca,cab,acb,bac,cba
6)WAP to remove all the characters in second string which are present in first string?
Input 1: ramesh
Input 2: suresh
Ouptut : us
7)WAP for own atoi function ?
Input : -123@4
Ouptut : -123
8)WAP for own atof function?
Input : -23.75#4
Ouput : -23.750000
9)WAP for reverse the string and words?
Input : world changed your thoughts
Ouput : sthguoht ruoy degnahc dlrow
10)WAP for reverse words in a string?
Input :world changed your thoughts
Ouput :dlrow degnahc ruoy sthguoht
11)WAP for reverse the words in line from given input line?
Input :Golconda fort located in Hyderabad
Ouput :Hyderabad in located fort Golconda
12)WAP for the given input string and the output string should be given as below:
Input :"132141567643"
Ouput :13:21:41:56:76:43
13)WAP for set all bits in an Integer which are right to the left most set bit?
Input - 8 (0000 0000 0000 1000)
Ouptut -15(0000 0000 0000 1111)
Input -138(0000 0000 1000 1010)
Ouput -255(0000 0000 1111 1111)
14)Given an array,sort the zero's from non zeros
Input : 1 2 0 0 7 4 4 2 0 0 0 6
Ouput: 1 2 7 4 4 2 6 0 0 0 0 0
15)A window of size k is sliding from left to right in an array of size n,find the maximum number
in the window at each window position.
Input : 1 2 3 1 4 5 2 3 6
Ouput : 3 3 4 5 5 5 6 (If User Entered k=3)
16)WAP to replace a substring into the main string(Without using any Inbuilt Functions)
Input 1 :"main string for substring replace program"
Input 2 :string
Input 3 :data
Ouput :main data for subdata replace program
17)WAP for sum of two numbers without using addition operator?
18)WAP to find the size of a variable without using the sizeof operator?
19)WAP to print a semicolon without using semicolon in the code?
20)WAP to count vowels & consonants in a string using switch case?
21)WAP to find second smallest & largest number in an unsorted array?
22)WAP to check the number is power of 2 (or) not?
23)WAP to print 1 to 100 without using loop?
24)WAP a program to merge two sorted unsigned integer arrays into a third unsigned integer array
in such a way that third array is also sorted.
Note:Do not sort the third array after merging it.Consider all arrays are sorted in ascending order.
25)Design a function to delete a Specific Node in a given single linked list?
26)Basic Programs and it's recursion also
a)Reverse a String
b)Reverse a Number
c)Palindrome
d)Prime Number
e)Leap Year
f)Fibonacci Series
g)HCF/LCM/GCD
h)Factorial of a Number
i)Armstrong Number
j)Average of two Numbers
k)Sum of Digits of a Number
l)Odd/Even
m)Strong Number
n)Perfect Number
o)Abundant Number
p)Swapping logics
q)Deficient Number
r)Star Number
s)Twin Prime
t)reversing the bits of a number
u)Patterns
v)Composite number
w)Binary
x)Octal
y)Decimal
z)Hexa Decimal
27)Basic String Programs
a)strcpy userdefined
b)strlen userdefined
c)strcmp userdefined
d)strcat userdefined
e)strchr userdefined
f)strrev userdefined
g)strstr userdefined
h)strncpy userdefined
i)strcpy using recursion
j)strlen using recursion
k)strcmp using recursion
l)strcat using recursion
m)strchr using recursion
n)strrev using recursion
o)strstr using recursion
p)strncpy using recursion
28)Basic Sorting Techniques
a)Bubble Sort
b)Selection Sort
c)Insertion Sort
d)Heap Sort
e)Merge Sort
f)Quick Sort
1)WAP to sort N Elements in Ascending Order and remaining elements in Descending Order?
Input :11 7 5 10 46 23 16 8
Ouptut: 5 7 11 46 23 16 10 8(If User Entered 'n' as 3)
2)WAP to Count the same positions if the String is reverse and Compare with Original String?
Input :alphxxdida
Output : 4
3)WAP for Data Encoder Application
Input :"Abbcddd eef ghhhijjj aabbc, omg"
Output :1A2b1c3d 2e1f 1g3h1i3j 2a2b1c1, 1o1m1g
4)WAP to check given string is a valid IPV4 address (or) not.If it is valid display true otherwise false.
Input : 192.168.1.1
Ouput : True
5)WAP to check the permutation of given string and print the ouptut?
Input :abc
Output :abc,bca,cab,acb,bac,cba
6)WAP to remove all the characters in second string which are present in first string?
Input 1: ramesh
Input 2: suresh
Ouptut : us
7)WAP for own atoi function ?
Input : -123@4
Ouptut : -123
8)WAP for own atof function?
Input : -23.75#4
Ouput : -23.750000
9)WAP for reverse the string and words?
Input : world changed your thoughts
Ouput : sthguoht ruoy degnahc dlrow
10)WAP for reverse words in a string?
Input :world changed your thoughts
Ouput :dlrow degnahc ruoy sthguoht
11)WAP for reverse the words in line from given input line?
Input :Golconda fort located in Hyderabad
Ouput :Hyderabad in located fort Golconda
12)WAP for the given input string and the output string should be given as below:
Input :"132141567643"
Ouput :13:21:41:56:76:43
13)WAP for set all bits in an Integer which are right to the left most set bit?
Input - 8 (0000 0000 0000 1000)
Ouptut -15(0000 0000 0000 1111)
Input -138(0000 0000 1000 1010)
Ouput -255(0000 0000 1111 1111)
14)Given an array,sort the zero's from non zeros
Input : 1 2 0 0 7 4 4 2 0 0 0 6
Ouput: 1 2 7 4 4 2 6 0 0 0 0 0
15)A window of size k is sliding from left to right in an array of size n,find the maximum number
in the window at each window position.
Input : 1 2 3 1 4 5 2 3 6
Ouput : 3 3 4 5 5 5 6 (If User Entered k=3)
16)WAP to replace a substring into the main string(Without using any Inbuilt Functions)
Input 1 :"main string for substring replace program"
Input 2 :string
Input 3 :data
Ouput :main data for subdata replace program
17)WAP for sum of two numbers without using addition operator?
18)WAP to find the size of a variable without using the sizeof operator?
19)WAP to print a semicolon without using semicolon in the code?
20)WAP to count vowels & consonants in a string using switch case?
21)WAP to find second smallest & largest number in an unsorted array?
22)WAP to check the number is power of 2 (or) not?
23)WAP to print 1 to 100 without using loop?
24)WAP a program to merge two sorted unsigned integer arrays into a third unsigned integer array
in such a way that third array is also sorted.
Note:Do not sort the third array after merging it.Consider all arrays are sorted in ascending order.
25)Design a function to delete a Specific Node in a given single linked list?
26)Basic Programs and it's recursion also
a)Reverse a String
b)Reverse a Number
c)Palindrome
d)Prime Number
e)Leap Year
f)Fibonacci Series
g)HCF/LCM/GCD
h)Factorial of a Number
i)Armstrong Number
j)Average of two Numbers
k)Sum of Digits of a Number
l)Odd/Even
m)Strong Number
n)Perfect Number
o)Abundant Number
p)Swapping logics
q)Deficient Number
r)Star Number
s)Twin Prime
t)reversing the bits of a number
u)Patterns
v)Composite number
w)Binary
x)Octal
y)Decimal
z)Hexa Decimal
27)Basic String Programs
a)strcpy userdefined
b)strlen userdefined
c)strcmp userdefined
d)strcat userdefined
e)strchr userdefined
f)strrev userdefined
g)strstr userdefined
h)strncpy userdefined
i)strcpy using recursion
j)strlen using recursion
k)strcmp using recursion
l)strcat using recursion
m)strchr using recursion
n)strrev using recursion
o)strstr using recursion
p)strncpy using recursion
28)Basic Sorting Techniques
a)Bubble Sort
b)Selection Sort
c)Insertion Sort
d)Heap Sort
e)Merge Sort
f)Quick Sort
NICE................
ReplyDelete