{"id":13974,"date":"2023-09-07T16:09:35","date_gmt":"2023-09-07T10:39:35","guid":{"rendered":"https:\/\/onlinefreenotes.com\/?p=13974"},"modified":"2025-12-12T11:50:16","modified_gmt":"2025-12-12T11:50:16","slug":"structure-in-c-seba-1","status":"publish","type":"post","link":"https:\/\/mockupbw.site\/2025\/onlinefreenotes\/structure-in-c-seba-1\/","title":{"rendered":"Structure in C: SEBA Class 10 Computer questions and answers"},"content":{"rendered":"\n<p>Get answers, questions, notes, textbook solutions, extras, pdf, mcqs, for Computer Chapter 9 <em>Structure in C<\/em> of class 10 (HSLC\/Madhyamik) for students studying under the Board of Secondary Education, Assam (<a href=\"https:\/\/sebaonline.org\/\" target=\"_blank\" rel=\"noopener\">SEBA<\/a>). These notes\/answers, however, should only be used for references and modifications\/changes can be made wherever possible.<\/p>\n\n\n  <style>\r\n    .notice {\r\n      background: yellow;       \/* simple yellow background *\/\r\n      text-align: center;       \/* centre alignment *\/\r\n      padding: 12px 16px;\r\n      margin: 20px auto;\r\n      width: fit-content;       \/* shrink to text and centre via auto margins *\/\r\n      font-family: Arial, sans-serif;\r\n    }\r\n  <\/style>\r\n  <div class=\"notice\">\r\n    If you notice any errors in the notes, please mention them in the comments\r\n  <\/div>\r\n<nav id=\"toc\" class=\"toc-box\"><\/nav>\r\n<style>\r\n.toc-box{\r\n  border:1px solid #e5e7eb;\r\n  border-radius:8px;\r\n  background:#fff;\r\n  margin:20px 0;\r\n  font-family:Arial, Helvetica, sans-serif\r\n}\r\n.toc-header{\r\n  padding:10px 14px;\r\n  font-size:16px;\r\n  font-weight:600;\r\n  border-bottom:1px solid #eef2f7;\r\n  background:#f8fafc\r\n}\r\n.toc-content{\r\n  padding:12px 18px\r\n}\r\n\r\n\/* Base list *\/\r\n.toc-content ul{\r\n  margin:0 25px;\r\n  padding-left:0;\r\n  list-style:none\r\n}\r\n\r\n\/* Level-based bullets *\/\r\n.toc-content li{\r\n  position:relative;\r\n  margin:6px 0;\r\n  margin-left:6px;\r\n  line-height:1.5;\r\n\tlist-style:disc;\r\n}\r\n\r\n\/* H2 bullet \u25cf *\/\r\n.toc-content li.level-2{\r\n  list-style:disc;\r\n\t\r\n}\r\n\r\n\/* H3 bullet \u25cb *\/\r\n.toc-content li.level-3{\r\n  margin-left:26px;\r\n\tlist-style:disc;\r\n}\r\n\r\n\r\n\/* H4+ bullet \u2013 *\/\r\n.toc-content li.level-4{\r\n  margin-left:46px;\r\n\tlist-style:disc;\r\n}\r\n.toc-content li.level-5,\r\n.toc-content li.level-6{\r\n  margin-left:66px;\r\n\tlist-style:disc;\r\n}\r\n\r\n.toc-content a{\r\n  text-decoration:none;\r\n  color:#000\r\n}\r\n.toc-content a:hover{\r\n  text-decoration:underline\r\n}\r\n\r\nhtml{scroll-behavior:smooth}\r\nh1[id],h2[id],h3[id],h4[id],h5[id],h6[id]{\r\n  scroll-margin-top:110px\r\n}\r\n<\/style>\r\n\r\n<script>\r\ndocument.addEventListener('DOMContentLoaded', function () {\r\n\r\n  const toc = document.getElementById('toc');\r\n  if (!toc) return;\r\n\r\n  \/* MAIN CONTENT ONLY *\/\r\n  const content = document.querySelector('#pdf-content');\r\n\r\n  \/* EXCLUDE AREAS *\/\r\n  const excludeSelectors = `\r\n    .author, .byline, .entry-meta, .post-meta,\r\n    #comments, .comments-area, .comment-respond,\r\n    .comment-form, .comment-list,\r\n    .login, .login-required,\r\n    .sidebar, aside, footer, nav,\r\n    .widget, .widgets\r\n  `;\r\n\r\n  \/* TEXT TO IGNORE *\/\r\n  const ignoreText = [\r\n    'leave a comment',\r\n    'cancel reply',\r\n    'login required',\r\n    'get notes',\r\n    'ron\\'e dutta',\r\n    'comments'\r\n  ];\r\n\r\n  \r\nconst headings = [...content.querySelectorAll('h1,h2,h3,h4,h5,h6')]\r\n  .filter(h => !excludeSelectors || !h.closest(excludeSelectors))\r\n  .filter(h => {\r\n    const txt = h.textContent.trim().toLowerCase();\r\n    return txt.length > 0 && !ignoreText.some(t => txt.includes(t));\r\n  });\r\n\r\n\/\/alert(content);\r\n  if (!headings.length) {\r\n    toc.style.display = 'none';\r\n    return;\r\n  }\r\n\r\n  \/* UNIQUE IDs *\/\r\n  const used = {};\r\n  const slug = t => t.toLowerCase().trim()\r\n    .replace(\/[^a-z0-9\\s-]\/g, '')\r\n    .replace(\/\\s+\/g, '-');\r\n\r\n  headings.forEach(h => {\r\n    if (!h.id) {\r\n      let base = slug(h.textContent) || 'section';\r\n      used[base] = (used[base] || 0) + 1;\r\n      h.id = used[base] > 1 ? base + '-' + used[base] : base;\r\n    }\r\n  });\r\n\r\n  \/* BUILD TOC *\/\r\n  const ul = document.createElement('ul');\r\n\r\n  headings.forEach(h => {\r\n    const level = parseInt(h.tagName.substring(1));\r\n    if (level < 2) return; \/\/ skip H1 like your reference site\r\n\r\n    const li = document.createElement('li');\r\n    li.className = 'level-' + level;\r\n\r\n    const a = document.createElement('a');\r\n    a.href = '#' + h.id;\r\n    a.textContent = h.textContent.trim();\r\n\r\n    li.appendChild(a);\r\n    ul.appendChild(li);\r\n  });\r\n\r\n  toc.innerHTML = `\r\n    <div class=\"toc-header\">Table of Contents<\/div>\r\n    <div class=\"toc-content\"><\/div>\r\n  `;\r\n  toc.querySelector('.toc-content').appendChild(ul);\r\n\r\n});\r\n<\/script>\r\n\n\n\n\n<h4 class=\"wp-block-heading\" id=\"Summary\"><strong>Summary<\/strong><\/h4>\n\n\n\n<p>In this chapter, we delve into the world of structures in C\u2014a versatile feature that allows you to group various data types under a single, user-defined umbrella. Imagine a structure as a mini-database where you can store different kinds of information, be it integers, characters, or floating-point numbers, all in one neat package.<\/p>\n\n\n\n<p>To define a structure, we use the keyword struct followed by a meaningful name, and then encapsulate its members within curly braces {}. Once you&#8217;ve created a structure, you can access its individual components using the dot (.) operator, like so: structureVariable.member.<\/p>\n\n\n\n<p>One of the benefits of structures is their flexibility. You can declare them either globally or locally, depending on your needs. But that&#8217;s not all; you can also create arrays of structures, a powerful feature that allows you to manage collections of complex data with ease.<\/p>\n\n\n\n<p>Structures aren&#8217;t just standalone entities; they can interact fluidly with other features of C programming. For instance, you can pass structures as arguments to functions, or even have functions return them. Pointers can be used to manipulate structure data, offering a new dimension of versatility. And when it comes to memory management, you can dynamically allocate memory for structures using functions like malloc() or calloc(), depending on how many records you wish to handle.<\/p>\n\n\n\n<p>Why are structures so useful, you ask? Consider real-world applications: Whether you&#8217;re building a system to manage student records, employee details, library book inventory, or bank accounts, structures serve as the backbone for these kinds of organized data repositories.<\/p>\n\n\n\n\n\n<h4 class=\"wp-block-heading\" id=\"Exercise\/textual_questions_and_answers\"><strong>Exercise\/textual questions and answers<\/strong><\/h4>\n\n\n\n<p><strong>1. Define structure in the context of a programming language. How is it different from an array?&nbsp;<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> Structure is a user defined data type that allows us to combine data of different types together. Structure helps to construct a complex data type that is more practical and meaningful. Structure is somewhat similar to an array, but an array holds data of similar type only. But structure on the other hand, can combine data of different types.<\/p>\n\n\n\n<p><strong>2. Is structure a built-in data type? Can we apply basic arithmetic operations such as addition, subtraction to structure variables? Show with a simple C program.<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> Structure is not a built-in data type in C. We cannot apply basic arithmetic operations such as addition, subtraction to structure variables. The following simple C program demonstrates this:<\/p>\n\n\n\n<p>#include &lt;stdio.h&gt;<br>struct Student {<br>&nbsp; int roll;<br>&nbsp; int age;<br>};<br>int main() {<br>&nbsp; struct Student s1, s2;<br>&nbsp; s1.roll = 1;<br>&nbsp; s1.age = 17;<br>&nbsp; s2.roll = 2;<br>&nbsp; s2.age = 18;<\/p>\n\n\n\n<p>&nbsp;\/\/ This will give compile time error<br>&nbsp; struct Student s3 = s1 + s2;<br>&nbsp; return 0;<br>}<\/p>\n\n\n\n<p>The above program will give a compile time error for the statement struct Student s3 = s1 + s2; because we cannot apply arithmetic operations like addition and subtraction to structure variables.<\/p>\n\n\n\n<p><strong>3. Identify the members of the structure from the below code segment:<\/strong><\/p>\n\n\n\n<p><strong>struct Account <\/strong><strong><br><\/strong><strong>{<\/strong><strong><br><\/strong><strong>&nbsp; char acNo[15];<\/strong><strong><br><\/strong><strong>&nbsp; char ifsc[15]; <\/strong><strong><br><\/strong><strong>&nbsp; char acType[7];<\/strong><strong><br><\/strong><strong>&nbsp; double balance;<\/strong><strong><br><\/strong><strong>&nbsp; double minBalance;<\/strong><strong><br><\/strong><strong>};<\/strong><\/p>\n\n\n\n<p><strong>struct Account account1, account2, account3, account[10];<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> The members of the structure Account are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>acNo (character array of size 15)<\/li>\n\n\n\n<li>ifsc (character array of size 15)<\/li>\n\n\n\n<li>acType (character array of size 7)<\/li>\n\n\n\n<li>balance (double)<\/li>\n\n\n\n<li>minBalance (double)<\/li>\n<\/ul>\n\n\n\n<p><strong>4. Identify the structure variables from the below code segment:&nbsp;<\/strong><\/p>\n\n\n\n<p><strong>struct Account <\/strong><strong><br><\/strong><strong>{<\/strong><strong><br><\/strong><strong>&nbsp; char acNo[15];<\/strong><strong><br><\/strong><strong>&nbsp; char ifsc[15];<\/strong><strong><br><\/strong><strong>&nbsp; char acType[7];<\/strong><strong><br><\/strong><strong>&nbsp; double balance; <\/strong><strong><br><\/strong><strong>&nbsp; double minBalance;<\/strong><strong><br><\/strong><strong>}<\/strong><\/p>\n\n\n\n<p><strong>struct Account account1, account2, account3, account[10];<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> The structure variables are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>account1<\/li>\n\n\n\n<li>account2<\/li>\n\n\n\n<li>account3<\/li>\n\n\n\n<li>account (array of 10 structure variables)<\/li>\n<\/ul>\n\n\n\n<p><strong>5. Consider the structure below and write statements for the following:<\/strong><\/p>\n\n\n\n<p><strong>a) to declare a variable of the structure<\/strong><strong><br><\/strong><strong>b) to display the age of the teacher<\/strong><\/p>\n\n\n\n<p><strong>struct Teacher <\/strong><strong><br><\/strong><strong>{<\/strong><strong><br><\/strong><strong>&nbsp; char name[30];<\/strong><strong><br><\/strong><strong>&nbsp; int age;<\/strong><strong><br><\/strong><strong>};<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> a) To declare a variable of Teacher structure:<\/p>\n\n\n\n<p>struct Teacher t1;<\/p>\n\n\n\n<p>b) To display the age of the teacher:<\/p>\n\n\n\n<p>printf(&#8220;Age of teacher: %d&#8221;, t1.age);<\/p>\n\n\n\n<p><strong>6. Declare a pointer for structure Teacher (from Q5) and dynamically allocate memory for 10 records.<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> #include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;string.h&gt;<br>struct Teacher<br>{<br>&nbsp; char name[30];<br>&nbsp; int age;<br>};<br>int main()<br>{<\/p>\n\n\n\n<p>\/\/ Declare a pointer to structure Teacher<br>&nbsp; struct Teacher *teacherArray;<\/p>\n\n\n\n<p>\/\/ Dynamically allocate memory for 10 records<br>&nbsp; teacherArray = (struct Teacher *) malloc(10 * sizeof(struct Teacher));<\/p>\n\n\n\n<p>\/\/ Check for memory allocation success<br>&nbsp; if (teacherArray == NULL)<br>&nbsp; {<br>&nbsp; &nbsp; printf(&#8220;Memory allocation failed!\\n&#8221;);<br>&nbsp; &nbsp; return 1;<br>&nbsp; }<\/p>\n\n\n\n<p>\/\/ Initialize the first record for demonstration<br>&nbsp; strcpy(teacherArray[0].name, &#8220;John Doe&#8221;);<br>&nbsp; teacherArray[0].age = 40;<\/p>\n\n\n\n<p>\/\/ Display the age of the first teacher<br>&nbsp; printf(&#8220;The age of the first teacher is %d\\n&#8221;, teacherArray[0].age);<\/p>\n\n\n\n<p>\/\/ Free the allocated memory<br>&nbsp; free(teacherArray);<br>return 0;<br>}<\/p>\n\n\n\n<p><strong>7. Consider the structure below and write statements for the following:<\/strong><\/p>\n\n\n\n<p><strong>a) to declare a pointer for the above structure and display the salary.<\/strong><strong><br><\/strong><strong>b) to declare a single pointer for two different variables of the higher structure and display the details of the employee whose salary is more.<\/strong><\/p>\n\n\n\n<p><strong>struct Employee <\/strong><strong><br><\/strong><strong>{<\/strong><strong><br><\/strong><strong>&nbsp; char name[30];<\/strong><strong><br><\/strong><strong>&nbsp; double salary;&nbsp; <\/strong><strong><br><\/strong><strong>};<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> a) #include &lt;stdio.h&gt;<br>#include &lt;string.h&gt;<br>struct Employee<br>{<br>&nbsp; char name[30];<br>&nbsp; double salary;<br>};<br>int main()<br>{<\/p>\n\n\n\n<p>\/\/ a) Declare a pointer for the structure<br>&nbsp; struct Employee *empPtr;<\/p>\n\n\n\n<p>\/\/ Allocate memory for the structure<br>&nbsp; empPtr = (struct Employee *) malloc(sizeof(struct Employee));<\/p>\n\n\n\n<p>\/\/ Check for memory allocation success<br>&nbsp; if (empPtr == NULL)<br>&nbsp; {<br>&nbsp; &nbsp; printf(&#8220;Memory allocation failed!\\n&#8221;);<br>&nbsp; &nbsp; return 1;<br>&nbsp; }<\/p>\n\n\n\n<p>\/\/ Initialize the employee details<br>&nbsp; strcpy(empPtr-&gt;name, &#8220;Alice&#8221;);<br>&nbsp; empPtr-&gt;salary = 50000.00;<\/p>\n\n\n\n<p>\/\/ Display the salary<br>&nbsp; printf(&#8220;The salary of the employee is %.2f\\n&#8221;, empPtr-&gt;salary);<\/p>\n\n\n\n<p>\/\/ Free the allocated memory<br>&nbsp; free(empPtr);<br>&nbsp; return 0;<br>}<\/p>\n\n\n\n<p>b) #include &lt;stdio.h&gt;<br>#include &lt;string.h&gt;<br>struct Employee<br>{<br>&nbsp; char name[30];<br>&nbsp; double salary;<br>};<br>int main()<br>{<\/p>\n\n\n\n<p>\/\/ Declare two variables of the structure<br>&nbsp; struct Employee emp1, emp2;<\/p>\n\n\n\n<p>\/\/ Initialize the first employee details<br>&nbsp; strcpy(emp1.name, &#8220;Alice&#8221;);<br>&nbsp; emp1.salary = 50000.00;<\/p>\n\n\n\n<p>\/\/ Initialize the second employee details<br>&nbsp; strcpy(emp2.name, &#8220;Bob&#8221;);<br>&nbsp; emp2.salary = 60000.00;<\/p>\n\n\n\n<p>\/\/ b) Declare a single pointer for two different variables<br>&nbsp; struct Employee *highestSalaryEmpPtr;<\/p>\n\n\n\n<p>\/\/ Determine whose salary is higher and point to that<br>&nbsp; if(emp1.salary &gt; emp2.salary)<br>&nbsp; {<br>&nbsp; &nbsp; highestSalaryEmpPtr = &amp;emp1;<br>&nbsp; }<br>&nbsp; else<br>&nbsp; {<br>&nbsp; &nbsp; highestSalaryEmpPtr = &amp;emp2;<br>&nbsp; }<\/p>\n\n\n\n<p>\/\/ Display details of the employee with the higher salary<br>&nbsp; printf(&#8220;The employee with the higher salary is %s with a salary of %.2f\\n&#8221;,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; highestSalaryEmpPtr-&gt;name, highestSalaryEmpPtr-&gt;salary);<br>&nbsp; return 0;<br>}<\/p>\n\n\n\n<p><strong>8. Rewrite the program of Q7 to facilitate dynamic memory allocation for N number of records where N is a user input.<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> #include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;string.h&gt;<br>struct Employee<br>{<br>&nbsp; char name[30];<br>&nbsp; double salary;<br>};<br>int main()<br>{<br>&nbsp; int N, i;<br>&nbsp; struct Employee *employees;<br>&nbsp; struct Employee *highestSalaryEmpPtr = NULL;<\/p>\n\n\n\n<p>\/\/ Ask the user for the number of records<br>&nbsp; printf(&#8220;Enter the number of employee records you want to enter: &#8220;);<br>&nbsp; scanf(&#8220;%d&#8221;, &amp;N);<\/p>\n\n\n\n<p>\/\/ Allocate memory for N records<br>&nbsp; employees = (struct Employee *) malloc(N * sizeof(struct Employee));<\/p>\n\n\n\n<p>\/\/ Check for memory allocation success<br>&nbsp; if (employees == NULL)<br>&nbsp; {<br>&nbsp; &nbsp; printf(&#8220;Memory allocation failed!\\n&#8221;);<br>&nbsp; &nbsp; return 1;<br>&nbsp; }<\/p>\n\n\n\n<p>\/\/ Input N records<br>&nbsp; for (i = 0; i &lt; N; ++i)<br>&nbsp; {<br>&nbsp; &nbsp; printf(&#8220;Enter details for employee %d\\n&#8221;, i + 1);<br>&nbsp; printf(&#8220;Name: &#8220;);<br>&nbsp; &nbsp; scanf(&#8220;%s&#8221;, employees[i].name);<br>&nbsp; &nbsp; printf(&#8220;Salary: &#8220;);<br>&nbsp; &nbsp; scanf(&#8220;%lf&#8221;, &amp;employees[i].salary);<br>&nbsp; }<\/p>\n\n\n\n<p>\/\/ Initialize the pointer to the first record<br>&nbsp; highestSalaryEmpPtr = &amp;employees[0];<\/p>\n\n\n\n<p>\/\/ Determine the employee with the highest salary<br>&nbsp; for (i = 1; i &lt; N; ++i)<br>&nbsp; {<br>&nbsp; &nbsp; if (employees[i].salary &gt; highestSalaryEmpPtr-&gt;salary)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; highestSalaryEmpPtr = &amp;employees[i];<br>&nbsp; &nbsp; }<br>&nbsp; }<\/p>\n\n\n\n<p>\/\/ Display the details of the employee with the highest salary<br>&nbsp; printf(&#8220;The employee with the highest salary is %s with a salary of %.2f\\n&#8221;,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; highestSalaryEmpPtr-&gt;name, highestSalaryEmpPtr-&gt;salary);<\/p>\n\n\n\n<p>\/\/ Free the allocated memory<br>&nbsp; free(employees);<br>&nbsp; return 0;<br>}<\/p>\n\n\n\n<p><strong>9. Consider the below structure and design a simple banking system that supports the following operations:<\/strong><\/p>\n\n\n\n<p><strong>a) opening of accounts (Hint: input to the variables) <\/strong><strong><br><\/strong><strong>b) displaying details based on account number<\/strong><strong><br><\/strong><strong>c) displaying all account details<\/strong><strong><br><\/strong><strong>d) displaying details of all accounts whose balance is more than 1000&nbsp; <\/strong><strong><br><\/strong><strong>e) depositing an amount to an account<\/strong><strong><br><\/strong><strong>f) withdrawing some amount from an account<\/strong><\/p>\n\n\n\n<p><strong>struct Account <\/strong><strong><br><\/strong><strong>{<\/strong><strong><br><\/strong><strong>&nbsp; char acNo[15];<\/strong><strong><br><\/strong><strong>&nbsp; char ifsc[15];<\/strong><strong><br><\/strong><strong>&nbsp; char acType[7];<\/strong><strong><br><\/strong><strong>&nbsp; double balance;<\/strong><strong><br><\/strong><strong>&nbsp; double minBalance;<\/strong><strong><br><\/strong><strong>};<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> #include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;string.h&gt;<br>struct Account<br>{<br>&nbsp; char acNo[15];<br>&nbsp; char ifsc[15];<br>&nbsp; char acType[7];<br>&nbsp; double balance;<br>&nbsp; double minBalance;<br>};<br>void openAccount(struct Account *acc, int *count);<br>void displayDetails(struct Account *acc, int count);<br>void displayAccount(struct Account *acc, int count, char *acNo);<br>void displayAboveThousand(struct Account *acc, int count);<br>void depositAmount(struct Account *acc, int count, char *acNo, double amount);<br>void withdrawAmount(struct Account *acc, int count, char *acNo, double amount);<br>int main()<br>{<br>&nbsp; struct Account accounts[100];<br>&nbsp; int count = 0;<br>&nbsp; int choice;<br>&nbsp; char acNo[15];<br>&nbsp; double amount;<br>&nbsp; while (1)<br>&nbsp; {<br>&nbsp; &nbsp; printf(&#8220;\\nBanking System Menu:\\n&#8221;);<br>&nbsp; &nbsp; printf(&#8220;1. Open Account\\n&#8221;);<br>&nbsp; &nbsp; printf(&#8220;2. Display Details Based on Account Number\\n&#8221;);<br>&nbsp; &nbsp; printf(&#8220;3. Display All Account Details\\n&#8221;);<br>&nbsp; &nbsp; printf(&#8220;4. Display Accounts with Balance &gt; 1000\\n&#8221;);<br>&nbsp; &nbsp; printf(&#8220;5. Deposit Amount\\n&#8221;);<br>&nbsp; &nbsp; printf(&#8220;6. Withdraw Amount\\n&#8221;);<br>&nbsp; &nbsp; printf(&#8220;7. Exit\\n&#8221;);<br>&nbsp; &nbsp; printf(&#8220;Enter your choice: &#8220;);<br>&nbsp; &nbsp; scanf(&#8220;%d&#8221;, &amp;choice);<br>&nbsp; &nbsp; switch (choice)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; case 1:<br>&nbsp; &nbsp; &nbsp; openAccount(accounts, &amp;count);<br>&nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; case 2:<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Enter account number: &#8220;);<br>&nbsp; &nbsp; &nbsp; scanf(&#8220;%s&#8221;, acNo);<br>&nbsp; &nbsp; &nbsp; displayAccount(accounts, count, acNo);<br>&nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; case 3:<br>&nbsp; &nbsp; &nbsp; displayDetails(accounts, count);<br>&nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; case 4:<br>&nbsp; &nbsp; &nbsp; displayAboveThousand(accounts, count);<br>&nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; case 5:<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Enter account number: &#8220;);<br>&nbsp; &nbsp; &nbsp; scanf(&#8220;%s&#8221;, acNo);<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Enter amount to deposit: &#8220;);<br>&nbsp; &nbsp; &nbsp; scanf(&#8220;%lf&#8221;, &amp;amount);<br>&nbsp; &nbsp; &nbsp; depositAmount(accounts, count, acNo, amount);<br>&nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; case 6:<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Enter account number: &#8220;);<br>&nbsp; &nbsp; &nbsp; scanf(&#8220;%s&#8221;, acNo);<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Enter amount to withdraw: &#8220;);<br>&nbsp; &nbsp; &nbsp; scanf(&#8220;%lf&#8221;, &amp;amount);<br>&nbsp; &nbsp; &nbsp; withdrawAmount(accounts, count, acNo, amount);<br>&nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; case 7:<br>&nbsp; &nbsp; &nbsp; exit(0);<br>&nbsp; &nbsp; default:<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Invalid choice!\\n&#8221;);<br>&nbsp; &nbsp; }<br>&nbsp; }<br>&nbsp; return 0;<br>}<br>void openAccount(struct Account *acc, int *count)<br>{<br>&nbsp; printf(&#8220;Enter account number: &#8220;);<br>&nbsp; scanf(&#8220;%s&#8221;, acc[*count].acNo);<br>&nbsp; printf(&#8220;Enter IFSC code: &#8220;);<br>&nbsp; scanf(&#8220;%s&#8221;, acc[*count].ifsc);<br>&nbsp; printf(&#8220;Enter account type (Saving\/Current): &#8220;);<br>&nbsp; scanf(&#8220;%s&#8221;, acc[*count].acType);<br>&nbsp; printf(&#8220;Enter initial balance: &#8220;);<br>&nbsp; scanf(&#8220;%lf&#8221;, &amp;acc[*count].balance);<br>&nbsp; printf(&#8220;Enter minimum balance: &#8220;);<br>&nbsp; scanf(&#8220;%lf&#8221;, &amp;acc[*count].minBalance);<br>&nbsp; (*count)++;<br>}<br>void displayDetails(struct Account *acc, int count)<br>{<br>&nbsp; for (int i = 0; i &lt; count; i++)<br>&nbsp; {<br>&nbsp; &nbsp; printf(&#8220;\\nAccount Number: %s\\n&#8221;, acc[i].acNo);<br>&nbsp; &nbsp; printf(&#8220;IFSC Code: %s\\n&#8221;, acc[i].ifsc);<br>&nbsp; &nbsp; printf(&#8220;Account Type: %s\\n&#8221;, acc[i].acType);<br>&nbsp; &nbsp; printf(&#8220;Balance: %.2f\\n&#8221;, acc[i].balance);<br>&nbsp; &nbsp; printf(&#8220;Minimum Balance: %.2f\\n&#8221;, acc[i].minBalance);<br>&nbsp; }<br>}<br>void displayAccount(struct Account *acc, int count, char *acNo)<br>{<br>&nbsp; for (int i = 0; i &lt; count; i++)<br>&nbsp; {<br>&nbsp; &nbsp; if (strcmp(acc[i].acNo, acNo) == 0)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; printf(&#8220;\\nAccount Number: %s\\n&#8221;, acc[i].acNo);<br>&nbsp; &nbsp; &nbsp; printf(&#8220;IFSC Code: %s\\n&#8221;, acc[i].ifsc);<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Account Type: %s\\n&#8221;, acc[i].acType);<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Balance: %.2f\\n&#8221;, acc[i].balance);<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Minimum Balance: %.2f\\n&#8221;, acc[i].minBalance);<br>&nbsp; &nbsp; &nbsp; return;<br>&nbsp; &nbsp; }<br>&nbsp; }<br>&nbsp; printf(&#8220;Account not found!\\n&#8221;);<br>}<br>void displayAboveThousand(struct Account *acc, int count)<br>{<br>&nbsp; for (int i = 0; i &lt; count; i++)<br>&nbsp; {<br>&nbsp; &nbsp; if (acc[i].balance &gt; 1000)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; printf(&#8220;\\nAccount Number: %s\\n&#8221;, acc[i].acNo);<br>&nbsp; &nbsp; &nbsp; printf(&#8220;IFSC Code: %s\\n&#8221;, acc[i].ifsc);<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Account Type: %s\\n&#8221;, acc[i].acType);<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Balance: %.2f\\n&#8221;, acc[i].balance);<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Minimum Balance: %.2f\\n&#8221;, acc[i].minBalance);<br>&nbsp; &nbsp; }<br>&nbsp; }<br>}<br>void depositAmount(struct Account *acc, int count, char *acNo, double amount)<br>{<br>&nbsp; for (int i = 0; i &lt; count; i++)<br>&nbsp; {<br>&nbsp; &nbsp; if (strcmp(acc[i].acNo, acNo) == 0)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; acc[i].balance += amount;<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Amount deposited. New balance: %.2f\\n&#8221;, acc[i].balance);<br>&nbsp; &nbsp; &nbsp; return;<br>&nbsp; &nbsp; }<br>&nbsp; }<br>&nbsp; printf(&#8220;Account not found!\\n&#8221;);<br>}<br>void withdrawAmount(struct Account *acc, int count, char *acNo, double amount)<br>{<br>&nbsp; for (int i = 0; i &lt; count; i++)<br>&nbsp; {<br>&nbsp; &nbsp; if (strcmp(acc[i].acNo, acNo) == 0)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; if (acc[i].balance &#8211; amount &lt; acc[i].minBalance)<br>&nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; printf(&#8220;Cannot withdraw! Balance will fall below minimum balance.\\n&#8221;);<br>&nbsp; &nbsp; &nbsp; &nbsp; return;<br>&nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; acc[i].balance -= amount;<br>&nbsp; &nbsp; &nbsp; printf(&#8220;Amount withdrawn. New balance: %.2f\\n&#8221;, acc[i].balance);<br>&nbsp; &nbsp; &nbsp; return;<br>&nbsp; &nbsp; }<br>&nbsp; }<br>&nbsp; printf(&#8220;Account not found!\\n&#8221;);<br>}<\/p>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>Get answers, questions, notes, textbook solutions, extras, pdf, mcqs, for Computer Chapter 9 Structure in C of class 10 (HSLC\/Madhyamik) for students studying under the Board of Secondary Education, Assam (SEBA). These notes\/answers, however, should only be used for references and modifications\/changes can be made wherever possible. Summary In this chapter, we delve into the&hellip; <a class=\"more-link\" href=\"https:\/\/mockupbw.site\/2025\/onlinefreenotes\/structure-in-c-seba-1\/\">Continue reading <span class=\"screen-reader-text\">Structure in C: SEBA Class 10 Computer questions and answers<\/span><\/a><\/p>\n","protected":false},"author":1044,"featured_media":13975,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,45],"tags":[245,115,29,573,30,41,213,33,35,36,44,37,735,53],"class_list":["post-13974","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-notes","category-seba","tag-assam-board","tag-chapter-9","tag-class-10","tag-computer","tag-extras","tag-hslc","tag-madhyamik","tag-notes","tag-pdf","tag-questions","tag-seba","tag-solutions","tag-structure-in-c","tag-textual-answers","entry"],"acf":[],"_links":{"self":[{"href":"https:\/\/mockupbw.site\/2025\/onlinefreenotes\/wp-json\/wp\/v2\/posts\/13974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mockupbw.site\/2025\/onlinefreenotes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mockupbw.site\/2025\/onlinefreenotes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mockupbw.site\/2025\/onlinefreenotes\/wp-json\/wp\/v2\/users\/1044"}],"replies":[{"embeddable":true,"href":"https:\/\/mockupbw.site\/2025\/onlinefreenotes\/wp-json\/wp\/v2\/comments?post=13974"}],"version-history":[{"count":1,"href":"https:\/\/mockupbw.site\/2025\/onlinefreenotes\/wp-json\/wp\/v2\/posts\/13974\/revisions"}],"predecessor-version":[{"id":33092,"href":"https:\/\/mockupbw.site\/2025\/onlinefreenotes\/wp-json\/wp\/v2\/posts\/13974\/revisions\/33092"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mockupbw.site\/2025\/onlinefreenotes\/wp-json\/wp\/v2\/media\/13975"}],"wp:attachment":[{"href":"https:\/\/mockupbw.site\/2025\/onlinefreenotes\/wp-json\/wp\/v2\/media?parent=13974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mockupbw.site\/2025\/onlinefreenotes\/wp-json\/wp\/v2\/categories?post=13974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mockupbw.site\/2025\/onlinefreenotes\/wp-json\/wp\/v2\/tags?post=13974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}