Professional Documents
Culture Documents
DSU Microroject Sample
DSU Microroject Sample
ASTUDY ON
MICRO PROJECT
Submitted by 4 students
PROF.MS.TAMANNA SHAIKH
in
Three Years Diploma in Engineering & Technology of Maharashtra State Board of Technical
Education, Mumbai (Autonomous)
SO 9001:2008 (ISO/IEC-27001:2013)
At
Certificate
Sr No. Title
1. Introduction
2. Abstract
3. Information
4. Code
5. Conclusion
6. Reference
INTRODUCTION
1.key objective is to introduce the basic concepts of software design. At one-level this is C-
specific: to learn to design, code and debug complete C programs. At another level, it is more
general: to learn the necessary skills to design large and complex software systems. This
involves learning to decompose large problems into manageable systems of modules; to use
modularity and clean interfaces to design for correctness, clarity and flexibility
2.Like arrays, Linked List is a linear data structure. Unlike arrays, linked list elements are not
stored at a contiguous location; the elements are linked using pointers.
Trinity Polytechnic Pune
a)Linked List is a very commonly used linear data structure which consists of group
of nodes in a sequence.
b)Each node holds its own data and the address of the next node hence forming a chain like
structure.
ii
ABSTRACT
About Project
In the main() function, we created two linked lists and called the function find First
Common() to find the first common element.
Computer Department
Trinity Polytechnic Pune
-Hence we have selected this topic and perform program in visual studio code and learn the
process of develop a ‘c’ program to find the first common element between the 2 given linked
lists and perform it successfully
iii
INFORMATION
Linked List
o Linked List can be defined as collection of objects called nodes that are randomly
stored in the memory.
o A node contains two fields i.e. data stored at that particular address and the pointer
which contains the address of the next node in the memory.
o The last node of the list contains pointer to the null.
Computer Department
Trinity Polytechnic Pune
You have to start somewhere, so we give the address of the first node a special name
called HEAD. Also, the last node in the linked list can be identified because its next
portion points to NULL.
Linked lists can be of multiple types: singly, doubly, and circular linked list. In this
article, we will focus on the singly linked list.
We wrap both the data item and the next node reference in a struct as:
struct node
{
int data;
struct node *next;
};
Computer Department
Trinity Polytechnic Pune
2
CODE
#include <stdio.h>
#include <stdlib.h>
struct node
{
int num;
struct node *next;
Computer Department
Trinity Polytechnic Pune
};
int main()
{
struct node *p = NULL, *q = NULL;
int result;
display(q);
Computer Department
Trinity Polytechnic Pune
return 0;
}
while (p != NULL)
{
temp = q;
while (temp != NULL)
{
if (temp->num == p->num)
{
return p->num;
}
4
temp = temp->next;
}
p = p->next;
}
return 0;
}
Computer Department
Trinity Polytechnic Pune
{
int c, ch;
struct node *temp, *rear;
do
{
printf("Enter number: ");
scanf("%d", &c);
temp = (struct node *)malloc(sizeof(struct node));
temp->num = c;
temp->next = NULL;
if (*head == NULL)
{
*head = temp;
}
else
{
rear->next = temp;
}
rear = temp;
5
printf("Do you wish to continue [1/0]: ");
scanf("%d", &ch);
} while (ch != 0);
printf("\n");
}
Computer Department
Trinity Polytechnic Pune
{
printf("%d\t", head->num);
head = head->next;
}
printf("\n");
}
PROGRAM OUTPUT
Computer Department
Trinity Polytechnic Pune
Computer Department
Trinity Polytechnic Pune
CONCLUSION
Computer Department
Trinity Polytechnic Pune
First we generated a number and then ask the user for answer k
times(trials)
If the guessed number is more than the real number, the program
will display the message "guessed number greater than the
actual number."
If the guessed number is less than the real number, the program
will display a message indicating that the guessed number is less
than the actual number.
If the guessed number is the same as the real number, or if all K
trials have been completed, the program will terminate with an
appropriate message.
To Guess the number we can use a binary search algorithm For
example if the number generated is 25 then we can first check if
the answer is (0+100/2)=50 as it is higher than then answer then
we will move our low to 0 and high to 50 then mid will be 25
which is the answer.
Computer Department
Trinity Polytechnic Pune
9
REFERENCES
https://www.scaler.com/topics/number-guessi
Computer Department
Trinity Polytechnic Pune
10
TEAM W0RK
Computer Department