NPTEL Problem Solving Trough Programming In C | NPTEL Week 9 Programming Assignment | NPTEL Assignment Solutions

NPTEL Problem Solving Trough Programming In C Week 9 Programming Assignment | NPTEL Swayam Assignment Answers


nptel problem solving through programming in c



Join Us On Telegram

👇👇👇👇👇👇
telegram


Join Us On Youtube

👇👇👇👇👇👇

youtube



Nptel Week 9 Programming Assignment Answers:


Q.1: Write a program to print all the locations at which a particular element (taken as input) is found in a list and also print the total number of times it occurs in the list. The location starts from 1.
For example if there are 4 elements in the array
5
6
5
7
If the element to search is 5,  then the output will be:
5 is present at location 1
5 is present at location 3
5 is present 2 times in the array.


write a program to print all the locations at which a particular element



Code:





Q.2: Write a C program to search a given element from a 1D array and display the position at which it is found by using linear search function. The index location starts from 1.


write a C program to search a given element from a 1D array



Code:





Q.3: Write a C program to search a given number from a sorted 1D array and display the position at which it is found using binary search algorithm.
The index location starts from 1.


display the position at which it is found using binary search algorithm




Code:






Q.4: Write a C program to reverse an array by swapping the elements and without using any new array.


write a C program to reverse an array by swapping the elements and without using any new array


Code:





If you are facing any queries regarding this assignment solutions, then please drop comment in comment section.

Post a Comment

0 Comments