tag:blogger.com,1999:blog-49254069090708577162024-03-28T17:22:58.220+05:30Introduction to ProgrammingThis blog assists in mastering C and C++ programming skills from basics to advanced levels.Unknownnoreply@blogger.comBlogger429125tag:blogger.com,1999:blog-4925406909070857716.post-66877389626183999652024-02-09T22:01:00.000+05:302024-02-09T22:01:13.290+05:30C File Management MCQs Set 2<h2 style="text-align: left;"><span style="color: #660000; font-family: Open Sans;">C File Management MCQs Set 2</span></h2><span style="font-family: Open Sans;"><b>1. What is the correct way to check if a file was opened successfully after using fopen()?<br /></b>(a) if (fopen(file_name, "mode") == NULL) { ... } <br />(b) if (file_pointer != NULL) { ... } <br />(c) if (errno == 0) { ... } <br />(d) None of the above<br /><br /><b>2. Which function closes a file in C?<br /></b>(a) fclose(file_name) <br />(b) close(file_pointer) <br />(c) close(file_name) <br />(d) Both (a) and (b)<br /><br /><b>3. Which function reads a single character from a file?<br /></b>(a) getchar() <br />(b) getc(file_pointer) <br />(c) fscanf(file_pointer, "%c") <br />(d) All of the above<br /><br /><b>4. How can you determine the current position (read/write pointer) within a file?</b><br />(a) ftell(file_pointer) <br />(b) fseek(file_pointer, 0, SEEK_CUR) <br />(c) fgetc(file_pointer) <br />(d) Both (a) and (b)<br /><br /><b>5. Which function closes an open file?<br /></b>(a) close(file)<br />(b) fclose(file)<br />(c) terminate(file)<br />(d) destroy(file)<br /><br /><b>6. What does the EOF macro represent?<br /></b>(a) End of File<br />(b) End of Stream<br />(c) End of Text<br />(d) End of Function<br /><br /><b>7. How do you check if a file has been opened successfully?<br /></b>(a) if (file != NULL)<br />(b) if (file != EOF)<br />(c) if (file > 0)<br />(d) if (file < 0)<br /><br /><b>>>> </b><a href="https://cprogrampracticals.blogspot.com/2024/02/c-file-management-mcqs-set-2-answers.html" target="_blank"><b><span style="color: #274e13;">Here is your answers</span></b></a></span><br /><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-28121617047202109392024-02-09T21:58:00.000+05:302024-02-09T21:58:00.797+05:30C File Management MCQs Set 2 - Answers<h2 style="text-align: left;"><span style="font-family: Open Sans;">C File Management MCQs Set 2 - Answers</span></h2><span style="font-family: Open Sans;"><b>1. What is the correct way to check if a file was opened successfully after using fopen()?<br /></b>(a) if (fopen(file_name, "mode") == NULL) { ... } <br />(b) if (file_pointer != NULL) { ... } <br />(c) if (errno == 0) { ... } <br />(d) None of the above<br /><br />Answer: (b) if (file_pointer != NULL) { ... }<br /><br /><b>Explanation:<br /></b>fopen() returns a FILE pointer, which is NULL on failure.<br /><br /><b>2. Which function closes a file in C?<br /></b>(a) fclose(file_name) <br />(b) close(file_pointer) <br />(c) close(file_name) <br />(d) Both (a) and (b)<br /><br />Answer: (d) Both (a) and (b)<br /><br /><b>Explanation:<br /></b>Both fclose(file_pointer) and close(file_pointer) are valid.<br /><br /><b>3. Which function reads a single character from a file?<br /></b>(a) getchar() <br />(b) getc(file_pointer) <br />(c) fscanf(file_pointer, "%c") <br />(d) All of the above<br /><br />Answer: (b) getc(file_pointer)<br /><br /><b>Explanation:<br /></b>getchar() reads from standard input, not files.<br />fscanf() is usually used for formatted input.<br /><br /><b>4. How can you determine the current position (read/write pointer) within a file?</b><br />(a) ftell(file_pointer) <br />(b) fseek(file_pointer, 0, SEEK_CUR) <br />(c) fgetc(file_pointer) <br />(d) Both (a) and (b)<br /><br />Answer: (d) Both (a) and (b)<br /><br /><b>Explanation:<br /></b>ftell(file_pointer) returns the current file position.<br />fseek(file_pointer, 0, SEEK_CUR) also retrieves the current position.<br /><br /><b>5. Which function closes an open file?<br /></b>(a) close(file)<br />(b) fclose(file)<br />(c) terminate(file)<br />(d) destroy(file)<br /><br />Answer: (b) fclose(file)<br /><br /><b>Explanation:<br /></b>fclose(file) is the standard C library function to close an open file.<br />Failing to close a file can lead to memory leaks and data corruption.<br /><br /><b>6. What does the EOF macro represent?<br /></b>(a) End of File<br />(b) End of Stream<br />(c) End of Text<br />(d) End of Function<br /><br />Answer: (a) End of File<br /><br /><b>Explanation:<br /></b>EOF is a macro defined in the stdio.h header, indicating the end of a file reached during reading.<br /><br /><b>7. How do you check if a file has been opened successfully?<br /></b>(a) if (file != NULL)<br />(b) if (file != EOF)<br />(c) if (file > 0)<br />(d) if (file < 0)<br /><br />Answer: (a) if (file != NULL). It is the correct way to check for successful file opening.<br /><br /><b>Explanation:<br /></b>fopen() returns a pointer to the opened file stream. If the opening fails, it returns NULL.<br /><br /></span><br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-10493917769204420152024-01-06T12:01:00.003+05:302024-01-06T12:09:35.883+05:30Flowcharts, Algorithms, and Pseudocode Key Differences<h1 style="text-align: left;"><b><span style="background-color: white; font-size: 16px; white-space-collapse: preserve;"><span style="color: #660000; font-family: Open Sans;">Differences between Flowcharts, Algorithms, and Pseudocode</span></span></b></h1><p><b style="color: #660000; font-family: "Open Sans"; white-space-collapse: preserve;">Flowchart</b></p><p></p><ul style="text-align: left;"><li><span style="color: #1f1f1f; font-family: "Open Sans"; white-space-collapse: preserve;">Visual representation: Uses symbols and connecting lines to depict the steps and flow of a process or algorithm.</span></li><li><span style="color: #1f1f1f; font-family: Open Sans;"><span style="white-space-collapse: preserve;">Easy to understand: Visual nature makes it accessible even for those without programming knowledge.</span></span></li><li><span style="color: #1f1f1f; font-family: Open Sans;"><span style="white-space-collapse: preserve;">Good for communication: Effective for explaining processes to non-technical audiences and collaborating within teams.</span></span></li><li><span style="color: #1f1f1f; font-family: Open Sans;"><span style="white-space-collapse: preserve;">Can be cumbersome for complex algorithms: May become unwieldy for large or intricate logic.</span></span></li></ul><p></p><div><span style="color: #660000; font-family: Open Sans;"><span style="white-space-collapse: preserve;"><b><br /></b></span></span></div><div><span style="color: #660000; font-family: Open Sans;"><span style="white-space-collapse: preserve;"><b>Algorithm</b></span></span></div><div><span style="font-family: Open Sans;"><span><div style="color: #1f1f1f; white-space-collapse: preserve;"><ul style="text-align: left;"><li>Step-by-step procedure: A precise, ordered set of instructions to solve a problem or achieve a task.</li><li>Foundation for problem-solving: Forms the basis for both flowcharts and pseudocode.</li><li>Can be expressed in various ways: Can be written in natural language, mathematical notation, or a combination of both.</li><li>Not necessarily executable: May require further translation into a programming language for implementation.</li></ul></div><div style="color: #1f1f1f; white-space-collapse: preserve;"><br /></div><div style="white-space-collapse: preserve;"><b><span style="color: #660000;">Pseudocode</span></b></div><div><ul style="color: #1f1f1f; text-align: left; white-space-collapse: preserve;"><li>Structured English-like language: Uses a combination of natural language and programming constructs to describe algorithms.</li><li>Close to actual code: Resembles real programming languages, making it easier to translate into code.</li><li>Good for detailed planning: Helps refine algorithms before coding, catching potential errors early.</li><li>Not standardized: Lacks strict syntax rules, allowing flexibility but potentially leading to inconsistencies.</li></ul><div><span style="color: #1f1f1f; white-space-collapse: preserve;">
</span><h2 style="background: white; line-height: normal; margin: 18pt 0cm; text-align: left; white-space-collapse: preserve;"><span face="Arial, sans-serif" style="font-size: 12pt;"><b><span style="color: #660000;">Key Differences Summary</span></b></span></h2><div style="white-space-collapse: preserve;"><span face="Arial, sans-serif" style="font-size: 12pt;"><b><span style="color: #660000;"><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgnkHJ6VBvfQ4LLU6k_l4ANF7eiaarswgEYj9bg4miCm9cBvfcD70YpBJpq4vNCPKPx5grwSyPuL8gt6HvC3tWX43c8FcZhxImAzPzo3yXlcXAOQ2urOvIBWqLAbvThr2L6ptgLBJrCJMqA9qLlZosColwdUKMR2msVxomvwb8D4FmIh7GnIcgBJZ8AE1Td" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="239" data-original-width="948" height="136" src="https://blogger.googleusercontent.com/img/a/AVvXsEgnkHJ6VBvfQ4LLU6k_l4ANF7eiaarswgEYj9bg4miCm9cBvfcD70YpBJpq4vNCPKPx5grwSyPuL8gt6HvC3tWX43c8FcZhxImAzPzo3yXlcXAOQ2urOvIBWqLAbvThr2L6ptgLBJrCJMqA9qLlZosColwdUKMR2msVxomvwb8D4FmIh7GnIcgBJZ8AE1Td=w536-h136" width="536" /></a></div><br /><br /></div></span></b></span></div><div style="text-align: left;"><span style="white-space-collapse: preserve;"><b>Best Practices
</b><ul style="text-align: left;"><li><span style="white-space-collapse: preserve;">Use <b>flowcharts </b>to visualize the overall flow of a process, especially for communication and collaboration.</span></li><li><span style="white-space-collapse: preserve;">Use <b>algorithms </b>to clearly define the problem-solving steps in a logical and concise manner.</span></li><li><span style="white-space-collapse: preserve;">Use <b>pseudocode </b>to refine algorithms and make them more concrete before actual coding, ensuring clarity and accuracy.</span></li></ul></span><span style="white-space-collapse: preserve;">
Consider using a combination of these tools for optimal results, depending on the specific task and audience.</span></div><div><span style="white-space-collapse: preserve;"><br /></span></div></div><div style="color: #1f1f1f; text-align: center; white-space-collapse: preserve;"><b><a href="https://cprogrampracticals.blogspot.com/">< Home ></a></b></div><div style="color: #1f1f1f; text-align: center; white-space-collapse: preserve;"><br /></div></div></span></span></div><p><span style="color: #1f1f1f; font-family: Open Sans;"><b><span style="background-color: white; white-space-collapse: preserve;"></span></b></span></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-56758908098204620102023-12-31T16:50:00.002+05:302023-12-31T16:50:24.471+05:30C Branching Statements MCQs with Answer - Set 2<h1 style="text-align: center;"><span style="color: #660000; font-family: Open Sans;">C - Branching Statements MCQs Set 2</span></h1><div><span style="font-family: Open Sans;"><br /></span></div><span style="font-family: Open Sans;">Followings are 10 important C programming MCQs on branching statements, along with their answers:</span><br /><br /><b style="font-family: "Open Sans";">1. Which of the following is not a branching statement in C?<br /></b><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><span style="font-family: Open Sans;">a) if </span><div><span style="font-family: Open Sans;">b) switch </span></div><div><span style="font-family: Open Sans;">c) while </span></div><div><span style="font-family: Open Sans;">d) goto</span></div></blockquote><div><br /><span style="font-family: Open Sans;">Answer: c) while (while is a looping statement, not a branching statement)</span><br /><br /><b style="font-family: "Open Sans";">2. What is the output of the following code?<br /></b><br /></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">int x = 10;</span></div><div><span style="font-family: Consolas;">if (x > 5) {</span></div><div><span style="font-family: Consolas;"> printf("x is greater than 5");</span></div><div><span style="font-family: Consolas;">} else {</span></div><div><span style="font-family: Consolas;"> printf("x is less than or equal to 5");</span></div><div><span style="font-family: Consolas;">}</span></div></blockquote><div><br /></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Open Sans;">a) x is greater than 5 </span></div><div><span style="font-family: Open Sans;">b) x is less than or equal to 5 </span></div><div><span style="font-family: Open Sans;">c) Compile error </span></div><div><span style="font-family: Open Sans;">d) Runtime error</span></div></blockquote><div><br /><span style="font-family: Open Sans;">Answer: a) x is greater than 5</span><br /><br /><b style="font-family: "Open Sans";">3. Which of the following is a multiway decision statement in C?<br /></b></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Open Sans;">a) if </span></div><div><span style="font-family: Open Sans;">b) switch </span></div><div><span style="font-family: Open Sans;">c) for </span></div><div><span style="font-family: Open Sans;">d) while</span></div></blockquote><div><br /><span style="font-family: Open Sans;">Answer: b) switch</span><br /><br /><b style="font-family: "Open Sans";">4. Is the default case compulsory in the switch case statement?<br /></b></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Open Sans;">a) Yes </span></div><div><span style="font-family: Open Sans;">b) No </span></div><div><span style="font-family: Open Sans;">c) Depends on the compiler</span></div><div><span style="font-family: Open Sans;">d) None of the above</span></div></blockquote><div><br /><span style="font-family: Open Sans;">Answer: b) No</span><br /><br /><b style="font-family: "Open Sans";">5. What happens when a break statement is encountered in a switch case?<br /></b></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Open Sans;">a) The program terminates</span></div><div><span style="font-family: Open Sans;">b) The switch statement terminates </span></div><div><span style="font-family: Open Sans;">c) The current loop terminates</span></div><div><span style="font-family: Open Sans;">d) None of the above</span></div></blockquote><div><br /><span style="font-family: Open Sans;">Answer: b) The switch statement terminates</span><br /><br /><b style="font-family: "Open Sans";">6. If the Boolean expression of an if statement evaluates to true, then which block of code is executed?</b><br /></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Open Sans;">a) The block inside the if statement </span></div><div><span style="font-family: Open Sans;">b) The block inside the else statement </span></div><div><span style="font-family: Open Sans;">c) Both blocks </span></div><div><span style="font-family: Open Sans;">d) None of the blocks</span></div></blockquote><div><br /><span style="font-family: Open Sans;">Answer: a) The block inside the if statement</span><br /><br /><b style="font-family: "Open Sans";">7. Can a switch statement have multiple case labels with the same value?<br /></b></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Open Sans;">a) Yes </span></div><div><span style="font-family: Open Sans;">b) No </span></div><div><span style="font-family: Open Sans;">c) Depends on the compiler </span></div><div><span style="font-family: Open Sans;">d) None of the above</span></div></blockquote><div><br /><span style="font-family: Open Sans;">Answer: a) Yes</span><br /><br /><b style="font-family: "Open Sans";">8. What is the output of the following code?<br /></b><br /></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">int num = 4;</span></div><div><span style="font-family: Consolas;">switch (num + 2) {</span></div><div><span style="font-family: Consolas;"> case 4: printf("4"); break;</span></div><div><span style="font-family: Consolas;"> case 3: printf("3"); break;</span></div><div><span style="font-family: Consolas;"> case 6: printf("6"); break;</span></div><div><span style="font-family: Consolas;">}</span></div></blockquote><div style="text-align: left;"><br /></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div style="text-align: left;"><span style="font-family: Open Sans;">a) 4 </span></div><div style="text-align: left;"><span style="font-family: Open Sans;">b) 3 </span></div><div style="text-align: left;"><span style="font-family: Open Sans;">c) 6 </span></div><div style="text-align: left;"><span style="font-family: Open Sans;">d) Compile error</span></div></blockquote><div style="text-align: left;"><br /><span style="font-family: Open Sans;">Answer: c) 6</span><br /><br /><b style="font-family: "Open Sans";">9. Can a break statement be used inside an if statement?<br /></b></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div style="text-align: left;"><span style="font-family: Open Sans;">a) Yes </span></div><div><span style="font-family: Open Sans;">b) No </span></div><div><span style="font-family: Open Sans;">c) Depends on the compiler </span></div><div><span style="font-family: Open Sans;">d) None of the above</span></div></blockquote><div><br /><span style="font-family: Open Sans;">Answer: b) No</span><br /><br /><b style="font-family: "Open Sans";">10. What is the purpose of the default case in a switch statement?<br /></b></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Open Sans;">a) To handle all cases that are not explicitly handled by other cases </span></div><div><span style="font-family: Open Sans;">b) To terminate the switch statement</span></div><div><span style="font-family: Open Sans;">c) To cause a compile error </span></div><div><span style="font-family: Open Sans;">d) None of the above</span></div></blockquote><div><br /><span style="font-family: Open Sans;">Answer: a) To handle all cases that are not explicitly handled by other cases</span><div><span style="font-family: Open Sans;"><br /></span></div><div style="text-align: center;"><span style="color: #660000; font-family: Open Sans;"><b><<a href="https://cprogrampracticals.blogspot.com/p/question-bank.html">Back to Question Bank</a>></b></span></div><div style="text-align: center;"><span style="color: #660000; font-family: Open Sans;"><b>< <a href="https://cprogrampracticals.blogspot.com/">HOME</a>> </b></span></div></div><div style="text-align: center;"><span style="color: #660000; font-family: Open Sans;"><b><br /></b></span></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-63912224311905229412023-12-30T17:31:00.002+05:302023-12-30T17:31:28.124+05:30Top 10 C Programming Libraries<h1 style="text-align: center;"><span style="color: #660000; font-family: Open Sans;">Top 10 C Programming Libraries</span></h1><p><span style="font-family: Open Sans;">Ranking C libraries can be very subjective, and dependent on your own usage. However, here are 10 C libraries that are widely used across various domains:</span></p><p data-sourcepos="3:1-3:23" style="background-color: white; margin: 24px 0px; white-space-collapse: preserve; word-break: break-word;"><span style="color: #274e13; font-family: Open Sans;"><b>1. Standard C Library (libc):</b></span></p><ul data-sourcepos="4:4-7:0" style="background-color: white; margin: 4px 0px; padding-inline-start: 36px;"><li data-sourcepos="4:4-4:57" style="margin-bottom: 10px;"><span style="font-family: Open Sans;">Foundational library included with every C compiler.</span></li><li data-sourcepos="5:4-5:118" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Provides essential functions for input/output, memory management, string manipulation, math operations, and more.</span></li><li data-sourcepos="6:4-7:0" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Basis for most C programming.</span></li></ul><p data-sourcepos="8:1-8:12" style="background-color: white; margin: 24px 0px; white-space-collapse: preserve; word-break: break-word;"><span style="color: #274e13; font-family: Open Sans;"><b>2. GLib:</b></span></p><ul data-sourcepos="9:4-10:71" style="background-color: white; margin: 4px 0px; padding-inline-start: 36px;"><li data-sourcepos="9:4-9:99" style="margin-bottom: 10px;"><span style="font-family: Open Sans;">General-purpose utility library used in many C projects, including GNOME desktop applications.</span></li><li data-sourcepos="10:4-10:71" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Offers data structures, functions for string handling, networking, file I/O, threading, and more.</span></li><li data-sourcepos="11:4-12:0" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Cross-platform and supports various programming paradigms.</span></li></ul><p data-sourcepos="13:1-13:15" style="background-color: white; margin: 24px 0px; white-space-collapse: preserve; word-break: break-word;"><span style="color: #274e13; font-family: Open Sans;"><b>3. OpenSSL:</b></span></p><ul data-sourcepos="14:4-17:0" style="background-color: white; margin: 4px 0px; padding-inline-start: 36px;"><li data-sourcepos="14:4-14:78" style="margin-bottom: 10px;"><span style="font-family: Open Sans;">Toolkit for implementing secure communication protocols like TLS and SSL.</span></li><li data-sourcepos="15:4-15:109" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Provides cryptographic functions for encryption, decryption, authentication, and certificate management.</span></li><li data-sourcepos="16:4-17:0" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Essential for building secure network applications.</span></li></ul><p data-sourcepos="18:1-18:15" style="background-color: white; margin: 24px 0px; white-space-collapse: preserve; word-break: break-word;"><span style="color: #274e13; font-family: Open Sans;"><b>4. libcurl:</b></span></p><ul data-sourcepos="19:4-21:11" style="background-color: white; margin: 4px 0px; padding-inline-start: 36px;"><li data-sourcepos="19:4-19:73" style="margin-bottom: 10px;"><span style="font-family: Open Sans;">Client-side URL transfer library for fetching data from web servers.</span></li><li data-sourcepos="20:4-20:101" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Supports various protocols (HTTP, HTTPS, FTP, etc.), authentication methods, and proxy settings.</span></li><li data-sourcepos="21:4-21:11" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Widely used in web applications and command-line tools.</span></li></ul><p data-sourcepos="23:1-23:14" style="background-color: white; margin: 24px 0px; white-space-collapse: preserve; word-break: break-word;"><span style="color: #274e13; font-family: Open Sans;"><b>5. libpng:</b></span></p><ul data-sourcepos="24:4-27:0" style="background-color: white; margin: 4px 0px; padding-inline-start: 36px;"><li data-sourcepos="24:4-24:63" style="margin-bottom: 10px;"><span style="font-family: Open Sans;">Reference library for reading and writing PNG image files.</span></li><li data-sourcepos="25:4-25:76" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Handles PNG compression, decompression, color management, and metadata.</span></li><li data-sourcepos="26:4-27:0" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Widely used for working with PNG images in C programs.</span></li></ul><p data-sourcepos="28:1-28:15" style="background-color: white; margin: 24px 0px; white-space-collapse: preserve; word-break: break-word;"><span style="color: #274e13; font-family: Open Sans;"><b>6. libjpeg:</b></span></p><ul data-sourcepos="29:4-32:0" style="background-color: white; margin: 4px 0px; padding-inline-start: 36px;"><li data-sourcepos="29:4-29:70" style="margin-bottom: 10px;"><span style="font-family: Open Sans;">Library for handling JPEG image files, similar to libpng for PNG.</span></li><li data-sourcepos="30:4-30:89" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Compresses and decompresses JPEG images, supports various color spaces and features.</span></li><li data-sourcepos="31:4-32:0" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Essential for working with JPEG images in C.</span></li></ul><p data-sourcepos="33:1-33:12" style="background-color: white; margin: 24px 0px; white-space-collapse: preserve; word-break: break-word;"><span style="color: #274e13; font-family: Open Sans;"><b>7. zlib:</b></span></p><ul data-sourcepos="34:4-37:0" style="background-color: white; margin: 4px 0px; padding-inline-start: 36px;"><li data-sourcepos="34:4-34:79" style="margin-bottom: 10px;"><span style="font-family: Open Sans;">General-purpose data compression library, often used with other libraries.</span></li><li data-sourcepos="35:4-35:97" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Implements the DEFLATE compression algorithm, commonly used in PNG, gzip, and other formats.</span></li><li data-sourcepos="36:4-37:0" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Reduces file sizes and network transfer times.</span></li></ul><p data-sourcepos="38:1-38:14" style="background-color: white; margin: 24px 0px; white-space-collapse: preserve; word-break: break-word;"><span style="color: #274e13; font-family: Open Sans;"><b>8. SQLite:</b></span></p><ul data-sourcepos="39:4-41:0" style="background-color: white; margin: 4px 0px; padding-inline-start: 36px;"><li data-sourcepos="39:4-39:116" style="margin-bottom: 10px;"><span style="font-family: Open Sans;">Embedded SQL database engine, allowing C programs to store and manage data without an external database server.</span></li><li data-sourcepos="40:4-41:0" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Self-contained, serverless, and lightweight, making it suitable for embedded systems and mobile apps.</span></li></ul><p data-sourcepos="42:1-42:38" style="background-color: white; margin: 24px 0px; white-space-collapse: preserve; word-break: break-word;"><span style="color: #274e13; font-family: Open Sans;"><b>9. SDL (Simple DirectMedia Layer):</b></span></p><ul data-sourcepos="43:4-45:0" style="background-color: white; margin: 4px 0px; padding-inline-start: 36px;"><li data-sourcepos="43:4-43:98" style="margin-bottom: 10px;"><span style="font-family: Open Sans;">Cross-platform library for multimedia programming, handling input, audio, graphics, and more.</span></li><li data-sourcepos="44:4-45:0" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Widely used for developing games, emulators, and media applications in C.</span></li></ul><p data-sourcepos="46:1-46:15" style="background-color: white; margin: 24px 0px; white-space-collapse: preserve; word-break: break-word;"><span style="color: #274e13; font-family: Open Sans;"><b>10. OpenGL:</b></span></p><p><span style="color: #274e13; font-family: Open Sans;"><b><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span><span style="background-color: white;"></span></b></span></p><ul data-sourcepos="47:4-48:88" style="background-color: white; margin: 4px 0px; padding-inline-start: 36px;"><li data-sourcepos="47:4-47:105" style="margin-bottom: 10px;"><span style="font-family: Open Sans;">Graphics API for rendering 2D and 3D graphics, often used with SDL for cross-platform compatibility.</span></li><li data-sourcepos="48:4-48:88" style="color: #1f1f1f; margin-bottom: 10px;"><span style="font-family: Open Sans;">Provides hardware-accelerated rendering for high-performance graphics applications.</span></li></ul><div><span style="color: #1f1f1f; font-family: Open Sans;"><br /></span></div><div style="text-align: center;"><span style="color: #660000; font-family: Open Sans;"><b>< <a href="https://cprogrampracticals.blogspot.com/">HOME </a>></b></span></div><div style="text-align: center;"><span style="color: #1f1f1f; font-family: Google Sans, Helvetica Neue, sans-serif;"><br /></span></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-41819063046448057302023-10-13T12:12:00.001+05:302023-10-13T12:18:17.139+05:30Flowchart to check prime number<h2 style="text-align: left;"><span style="color: #660000; font-family: Open Sans;">Prime Number</span></h2><div><span style="font-family: Open Sans;">" a whole number greater than 1 that cannot be exactly divided by any whole number other than itself and 1 (e.g. 2, 3, 5, 7, 11)."</span></div><div><span style="font-family: Open Sans;"><br />Prime numbers are very useful in cryptography.</span></div><div><span style="font-family: Open Sans;"><br /></span></div><div><h2 style="text-align: left;"><span style="color: #660000; font-family: Open Sans;">Flowchart to check a Prime Number</span></h2><div><span style="font-family: Open Sans;">Following flowchart is prepared using a RAPTOR software.</span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7zzczxB3GUwpbUF_32u2UTd1uajF7HHYDCj4vlsn1K5jphVyx0b7tK9qE2OCq_SRJzCm09P2KOfa2VO6wNWBm6LosJFaLh320fBPU7wHrmfb7f-ZAcmJSjicxnD2Y36BE4o7qpnEBSi9-PFbwSJ6lf1LYNWz69jt8fuORoGDHSKcjC077JznVnm5CW4v9/s1154/prime%20number%20flowchart.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Prime number Flowchart" border="0" data-original-height="1154" data-original-width="596" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7zzczxB3GUwpbUF_32u2UTd1uajF7HHYDCj4vlsn1K5jphVyx0b7tK9qE2OCq_SRJzCm09P2KOfa2VO6wNWBm6LosJFaLh320fBPU7wHrmfb7f-ZAcmJSjicxnD2Y36BE4o7qpnEBSi9-PFbwSJ6lf1LYNWz69jt8fuORoGDHSKcjC077JznVnm5CW4v9/s16000/prime%20number%20flowchart.png" title="Prime number Flowchart" /></a></div></div><h3 style="text-align: left;"><span style="color: #274e13; font-family: Open Sans;"><b>Python Logic to check a prime number.</b></span></h3><div><div style="background-color: #f7f7f7; font-family: monospace, Consolas, "Courier New", monospace; line-height: 19px; white-space: pre;"><div><span style="font-size: medium;"><span style="color: blue;">def</span> <span style="color: #795e26;">is_prime</span>(<span style="color: #001080;">n</span>):</span></div><div><span style="font-size: medium;"> <span style="color: #af00db;">if</span> n <= <span style="color: #098156;">1</span>:</span></div><div><span style="font-size: medium;"> <span style="color: #af00db;">return</span> <span style="color: blue;">False</span></span></div><div><span style="font-size: medium;"> <span style="color: #af00db;">for</span> i <span style="color: blue;">in</span> <span style="color: #795e26;">range</span>(<span style="color: #098156;">2</span>, <span style="color: #257693;">int</span>(n**<span style="color: #098156;">0.5</span>) + <span style="color: #098156;">1</span>):</span></div><div><span style="font-size: medium;"> <span style="color: #af00db;">if</span> n % i == <span style="color: #098156;">0</span>:</span></div><div><span style="font-size: medium;"> <span style="color: #af00db;">return</span> <span style="color: blue;">False</span></span></div><div><span style="font-size: medium;"> <span style="color: #af00db;">return</span> <span style="color: blue;">True</span></span></div></div></div><div><span style="font-family: Open Sans;"><br /></span></div><div><span style="color: #274e13; font-family: Open Sans;"><b>Output of python program:</b></span></div><div><span style="font-family: Open Sans;"><br /></span></div><div><span style="font-family: Open Sans;">is_prime(5)</span></div><div><span style="font-family: Open Sans;">True</span></div></div><div><span style="font-family: Open Sans;"><br /></span></div><div style="text-align: center;"><span style="font-family: Open Sans;">< <b><a href="https://cprogrampracticals.blogspot.com/p/flowchart.html"><span style="font-size: medium;">Back to Flowchart Page</span></a></b> ></span></div><div style="text-align: center;"><span style="font-family: Open Sans;">< <a href="https://cprogrampracticals.blogspot.com/"><b><span style="font-size: medium;">Home </span></b></a>></span></div><div><span style="font-family: Open Sans;"><br /></span></div><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-33629660409580810942023-09-08T17:09:00.001+05:302023-11-02T11:48:19.875+05:30C Operators MCQs Set 2<h1 style="text-align: center;"><span style="color: #660000; font-family: Open Sans;"><b>C Operators MCQs Set 2</b></span></h1><p><span style="font-family: Open Sans;"><b>Important MCQs based on C Programming Operators. </b></span></p><p><span style="font-family: Open Sans;"><br /></span></p><p><span style="font-family: Open Sans;"><b>1. What does the <span style="color: #274e13;">%</span> operator do in C?</b></span></p><p><span style="font-family: Open Sans;">a) Addition</span></p><p><span style="font-family: Open Sans;">b) Subtraction</span></p><p><span style="font-family: Open Sans;">c) Multiplication</span></p><p><span style="font-family: Open Sans;">d) Modulus</span></p><p><span style="font-family: Open Sans;"><br /></span></p><p><span style="font-family: Open Sans;"><b>2. Which operator is used for logical NOT in C?</b></span></p><p><span style="font-family: Open Sans;">a) &</span></p><p><span style="font-family: Open Sans;">b) &&</span></p><p><span style="font-family: Open Sans;">c) !</span></p><p><span style="font-family: Open Sans;">d) ||</span></p><p><span style="font-family: Open Sans;"><br /></span></p><p><span style="font-family: Open Sans;"><b>3. What is the result of the expression <span style="color: #274e13;">5 + 3 * 2</span> in C?</b></span></p><p><span style="font-family: Open Sans;">a) 10</span></p><p><span style="font-family: Open Sans;">b) 16</span></p><p><span style="font-family: Open Sans;">c) 11</span></p><p><span style="font-family: Open Sans;">d) 13</span></p><p><span style="font-family: Open Sans;"><br /></span></p><p><span style="font-family: Open Sans;"><b>4. What is the result of the expression <span style="color: #274e13;">10 / 3</span> in C?</b></span></p><p><span style="font-family: Open Sans;">a) 3.3333</span></p><p><span style="font-family: Open Sans;">b) 3</span></p><p><span style="font-family: Open Sans;">c) 3.0</span></p><p><span style="font-family: Open Sans;">d) 4</span></p><p><span style="font-family: Open Sans;"><br /></span></p><p><span style="font-family: Open Sans;"><b>5. Which operator is used to check if two values are equal in C?</b></span></p><p><span style="font-family: Open Sans;">a) ==</span></p><p><span style="font-family: Open Sans;">b) =</span></p><p><span style="font-family: Open Sans;">c) !=</span></p><p><span style="font-family: Open Sans;">d) ===</span></p><p><span style="font-family: Open Sans;"><br /></span></p><p><span style="font-family: Open Sans;"><b>6. What does the <span style="color: #274e13;">++</span> operator do when placed before a variable, like ++x?</b></span></p><p><span style="font-family: Open Sans;">a) Decrements the variable by 1</span></p><p><span style="font-family: Open Sans;">b) Multiplies the variable by 2</span></p><p><span style="font-family: Open Sans;">c) Increments the variable by 1</span></p><p><span style="font-family: Open Sans;">d) Doubles the value of the variable</span></p><p><span style="font-family: Open Sans;"><br /></span></p><p><span style="font-family: Open Sans;"><b>7. Which operator is used to access the value stored at a memory address in C?</b></span></p><p><span style="font-family: Open Sans;">a) &</span></p><p><span style="font-family: Open Sans;">b) *</span></p><p><span style="font-family: Open Sans;">c) -></span></p><p><span style="font-family: Open Sans;">d) .</span></p><p><span style="font-family: Open Sans;"><br /></span></p><p><span style="font-family: Open Sans;"><b>8. What does the <span style="color: #274e13;">+=</span> operator do in C?</b></span></p><p><span style="font-family: Open Sans;">a) Subtracts the right-hand value from the left-hand value</span></p><p><span style="font-family: Open Sans;">b) Multiplies the left-hand value by the right-hand value</span></p><p><span style="font-family: Open Sans;">c) Adds the right-hand value to the left-hand value</span></p><p><span style="font-family: Open Sans;">d) Divides the left-hand value by the right-hand value</span></p><p><span style="font-family: Open Sans;"><br /></span></p><p><span style="font-family: Open Sans;"><b>9. Which operator is used to shift the bits of a number to the left in C?</b></span></p><p><span style="font-family: Open Sans;">a) >></span></p><p><span style="font-family: Open Sans;">b) <<</span></p><p><span style="font-family: Open Sans;">c) &</span></p><p><span style="font-family: Open Sans;">d) |</span></p><p><span style="font-family: Open Sans;"><br /></span></p><p><span style="font-family: Open Sans;"><b>10. What does the ternary conditional operator <span style="color: #274e13;">? :</span> do in C?</b></span></p><p><span style="font-family: Open Sans;">a) It checks if a condition is true and returns 1 if true, 0 if false.</span></p><p><span style="font-family: Open Sans;">b) It assigns a value to a variable.</span></p><p><span style="font-family: Open Sans;">c) It performs addition.</span></p><p><span style="font-family: Open Sans;">d) It provides a shorthand way to write an if-else statement.</span></p><p><span style="font-family: Open Sans;"><br /></span></p>
<p><span style="color: #274e13; font-family: Open Sans;"><b>Correct Answers:</b></span></p><p><span style="font-family: Open Sans;"><br /></span></p><p><span style="font-family: Open Sans;">1. d) Modulus</span></p><p><span style="font-family: Open Sans;">2. c) !</span></p><p><span style="font-family: Open Sans;">3. c) 11</span></p><p><span style="font-family: Open Sans;">4. b) 3</span></p><p><span style="font-family: Open Sans;">5. a) ==</span></p><p><span style="font-family: Open Sans;">6. c) Increments the variable by 1</span></p><p><span style="font-family: Open Sans;">7. b) *</span></p><p><span style="font-family: Open Sans;">8. c) Adds the right-hand value to the left-hand value</span></p><p><span style="font-family: Open Sans;">9. b) <<</span></p><p><span style="font-family: Open Sans;">10 d) It provides a shorthand way to write an if-else statement.</span></p><p><span style="font-family: Open Sans;"><br /></span></p><p style="text-align: center;"><span style="font-family: Open Sans;"><b>< <a href="https://cprogrampracticals.blogspot.com/p/question-bank.html">Back to Question Bank</a> ></b></span></p><p style="text-align: center;"><span style="font-family: Open Sans;"><b>< <a href="https://cprogrampracticals.blogspot.com/" target="_blank">Home </a>></b></span></p><p><span style="font-family: Open Sans;"><br /></span></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-18100021786776351312023-06-12T14:12:00.002+05:302023-06-12T14:14:42.605+05:30Top 10 C Programming Topics for Beginners<p><span style="font-family: Open Sans;">Followings are the top 10 topics for the C programming beginners. These topics are essential for understanding the C programming language and for writing effective C programs:</span></p><h3 style="text-align: left;"><span style="color: #660000; font-family: Open Sans;"><b>Top 10 Topics for C Programming Beginners</b></span></h3><p class="MsoNormal"><span style="font-family: Open Sans;"><b><o:p></o:p></b></span></p>
<ol start="1" style="margin-top: 0in;" type="1">
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="font-family: Open Sans;">Data
types<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="font-family: Open Sans;">Variables<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="font-family: Open Sans;">Input
/ Output (I/O) Operations<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="font-family: Open Sans;">Operators<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="font-family: Open Sans;">Control
flow statements<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="font-family: Open Sans;">Functions<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="font-family: Open Sans;">Arrays<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="font-family: Open Sans;">Strings<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="font-family: Open Sans;">Pointers<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="font-family: Open Sans;">File
handling<o:p></o:p></span></li>
</ol>
<p class="MsoNormal"><span style="font-family: Open Sans;">Here is a brief overview of each topic:<o:p></o:p></span></p>
<ul style="margin-top: 0in;" type="disc">
<li class="MsoNormal" style="mso-list: l0 level1 lfo2; tab-stops: list .5in;"><span style="font-family: Open Sans;"><b>Data
types:</b> Data types are the building blocks of C programs. They define the
type of data that can be stored in a variable.<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l0 level1 lfo2; tab-stops: list .5in;"><span style="font-family: Open Sans;"><b>Variables:</b>
Variables are used to store data. They are given names and can be used to
store values of different data types.<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l0 level1 lfo2; tab-stops: list .5in;"><span style="font-family: Open Sans;"><b>Input
/ Output (I/O) Operations: </b>I/O operations are used to manage data input from
the user or a File. printf() and scanf() are two popular I/O functions.<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l0 level1 lfo2; tab-stops: list .5in;"><span style="font-family: Open Sans;"><b>Operators:
</b> Operators are used to perform operations on data. They can be used to
perform arithmetic operations, logical operations, and string operations.<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l0 level1 lfo2; tab-stops: list .5in;"><span style="font-family: Open Sans;"><b>Control
flow statements: </b>Control flow statements are used to control the flow of
execution of a C program. They can be used to make decisions, loops, and
jumps.<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l0 level1 lfo2; tab-stops: list .5in;"><span style="font-family: Open Sans;"><b>Functions:
</b> Functions are blocks of code that are reusable. They can be called from
other parts of a C program.<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l0 level1 lfo2; tab-stops: list .5in;"><span style="font-family: Open Sans;"><b>Arrays:
</b> Arrays are variables that can store multiple values of the same data type.<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l0 level1 lfo2; tab-stops: list .5in;"><span style="font-family: Open Sans;"><b>Strings:
</b> Strings are arrays of characters. They are used to store text data.<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l0 level1 lfo2; tab-stops: list .5in;"><span style="font-family: Open Sans;"><b>Pointers:
</b> Pointers are variables that store the address of another variable. They
can be used to access the value of another variable indirectly.<o:p></o:p></span></li>
<li class="MsoNormal" style="mso-list: l0 level1 lfo2; tab-stops: list .5in;"><span style="font-family: Open Sans;"><b>File
handling: </b>File handling is used to read and write data to files. It is a
powerful tool that can be used to store and retrieve data from files.<o:p></o:p></span></li>
</ul>
<p class="MsoNormal"><span style="font-family: Open Sans;">These are just a few of the many topics that every C
programming beginners should learn. If you are interested in learning C
programming, we recommend that you find a good book or online <b>Self Study Tutorials</b> that covers these
topics in detail.</span><o:p></o:p></p><p class="MsoNormal"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://cprogrampracticals.blogspot.com/" imageanchor="1" style="margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" data-original-height="34" data-original-width="102" height="34" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifRs9vQcCTBvvL3wk6u3k2yeYoE2W8QimgZlm_OYX-6zUKdWMM7RUAzX35gQEWNxwPxsL8h1W5qNW0WZ5dqj5LRZJFl7Z5uIjb2Gt3aRznlBOa5lHjwu2eLOBODx22F9I4ypLYcQF2brFgpIlknkAP5IOQ1RyQ0y10UvfITCXjI3IZmGYAQXgd3JKNQQ/s1600/button_home.png" width="102" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><span style="font-family: Open Sans;"><br /></span><p></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-80790891754451510632023-04-18T16:34:00.001+05:302023-04-18T16:34:30.034+05:30C Programming Predict Output Strings MCQs Set 3 - Answer<h3 style="text-align: left;"><span style="color: #660000; font-family: Open Sans;">Predict Output MCQs Based On C Programming Strings - Answer</span></h3><div><span style="color: #38761d; font-family: Open Sans;"><b> 1. What is the output of the following C program?<br /></b></span><br /></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">#include <stdio.h></span></div></blockquote><div><br /></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">int main() {</span></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">char str1[] = "hello";</span></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">char str2[] = "world";</span></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">printf("%s", str1);</span></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">printf("%s", str2);</span></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">return 0;</span></div></blockquote></blockquote><blockquote style="border: none; margin: 0 0 0 40px; padding: 0px;"><div style="text-align: left;"><span style="font-family: Consolas;">}</span></div></blockquote><div><br /></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">A) helloworld</span></div><div><span style="font-family: Consolas;">B) hello world</span></div><div><span style="font-family: Consolas;">C) hello</span></div><div><span style="font-family: Consolas;"> world</span></div><div><span style="font-family: Consolas;">D) Compilation error</span></div></blockquote><div><br /><span style="font-family: Consolas;"><b>Answer</b>: A) helloworld</span><br /><br /><span style="font-family: Consolas;"><b>Explanation</b>: str1 array contains the string "hello", and str2 contains the string "world". The printf function outputs str1 followed by str2, which results in "helloworld".</span><br /><br /><span style="color: #38761d; font-family: Open Sans;"><b>2. What is the output of the following C program?<br /></b></span><br /></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">#include <stdio.h></span></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">int main() {</span></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">char str[] = "hello";</span></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">printf("%c", str[3]);</span></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">return 0;</span></div></blockquote></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">}</span></div></blockquote><div><br /></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><span style="font-family: Consolas;">A) h</span></div><div><span style="font-family: Consolas;">B) e</span></div><div><span style="font-family: Consolas;">C) l</span></div><div><span style="font-family: Consolas;">D) o</span></div></blockquote><div><br /><span style="font-family: Consolas;"><b>Answer</b>: C) l</span><br /><br /><span style="font-family: Consolas;"><b>Explanation</b>: The str array contains the string "hello". The expression str[3] retrieves the character at index 3 of the array, which is 'l'. Hence program outputs 'l'.</span><br /><br /><span style="color: #38761d; font-family: Open Sans;"><b>3. What is the output of the following C program?<br /></b></span><br /></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">#include <stdio.h></span></div></div><div><div><span style="font-family: Consolas;">int main() {</span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">char str1[] = "hello";</span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">char str2[] = "world";</span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">printf("%s", str1 + 3);</span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">printf("%s", str2 + 1);</span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">return 0;</span></div></div></blockquote></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">}</span></div></div><div><div><span style="font-family: Consolas;">A) loorld</span></div></div><div><div><span style="font-family: Consolas;">B) loorldw</span></div></div><div><div><span style="font-family: Consolas;">C) loworld</span></div></div><div><div><span style="font-family: Consolas;">D) helloworld</span></div></div></blockquote><div><div><span style="font-family: Consolas;"><br /><b>Answer</b>: A) loorld<br /><br /></span></div><div><b style="font-family: Consolas;">Explanation</b><span style="font-family: Consolas;">: The expression str1 + 3 evaluates to a pointer to the fourth character of str1, which is 'l'. The printf function then outputs the remaining characters of str1 starting from the fourth character, which is "lo". Similarly, the expression str2 + 1 evaluates to a pointer to the second character of str2, which is 'o'. The printf function then outputs the remaining characters of str2 starting from the second character, which is "orld". Hence, final output will be "loorld".</span><br /><br /><span style="color: #38761d; font-family: Open Sans;"><b>4. What is the output of the following C program?<br /></b></span><br /></div></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">#include <stdio.h></span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">int main() {</span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">char str[] = "hello";</span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">str[2] = '\0';</span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">printf("%s", str);</span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">return 0;</span></div></div></blockquote></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">}</span></div></div><div><div><span style="font-family: Consolas;">A) hel</span></div></div><div><div><span style="font-family: Consolas;">B) he</span></div></div><div><div><span style="font-family: Consolas;">C) hello</span></div></div><div><div><span style="font-family: Consolas;">D) Compilation error</span></div></div></blockquote><div><div><br /><b style="font-family: Consolas;">Answer</b><span style="font-family: Consolas;">: B) he</span><br /><br /><b style="font-family: Consolas;">Explanation</b><span style="font-family: Consolas;">: The str contains the string "hello". The statement str[2] = '\0' sets the third character of str to the null character, which terminates the string. The printf function then outputs the characters of str up to the null character, which is "he".</span><br /><br /><span style="color: #38761d; font-family: Open Sans;"><b>5. What is the output of the following C program?<br /></b></span><br /></div></div><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">#include <stdio.h></span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">int main() {</span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">int arr[] = {2, 3, 4};</span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">int *p = arr;</span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">printf("%d", *(p + 1));</span></div></div></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">return 0;</span></div></div></blockquote></blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><div><div><span style="font-family: Consolas;">}</span></div></div><div><div><span style="font-family: Consolas;">A) 2</span></div></div><div><div><span style="font-family: Consolas;">B) 3</span></div></div><div><div><span style="font-family: Consolas;">C) 4</span></div></div><div><div><span style="font-family: Consolas;">D) Compilation error</span></div></div></blockquote><div><div><br /><span style="font-family: Consolas;"><b>Answer</b>: B) 3</span><br /><br /><span style="font-family: Consolas;"><b>Explanation</b>: The pointer p points to the first element of the array arr. The expression *(p + 1) adds 1 to the pointer p to point to the second element of the array, and then evaluates to the value pointed to by the new pointer, which is 3.</span><br /></div><div><span style="font-family: Consolas;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://cprogrampracticals.blogspot.com/" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="34" data-original-width="102" height="34" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_ZQHBviP1cw5sKvf2XXWsCkVwzX0EWWJZo6ESwaPrLvi_hlnJfAxgEzqYwJADBa1la9GgUALHm2-6KJOOlG6s3Brxy7U1uYAOqUR2U96FHjSfFfeyKWSZ_V0shEnV2Rn-7nd2-mOQupOsHCl5caAfHbXjcuEzplXIPvEYgmEtREpvYW6SjOd9TmDy6g/s1600/button_home.png" width="102" /></a></div><br /><span style="font-family: Consolas;"><br /></span></div><div><br /></div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-23546865771447700862023-04-18T14:38:00.003+05:302023-04-18T16:47:05.347+05:30C Programming String Predict Output MCQs Set 3<h3 style="text-align: left;"><span style="color: #660000; font-family: Open Sans;"><b> Predict output MCQs based on C Programming Strings</b></span></h3><p><span style="color: #38761d; font-family: Open Sans;"><b>1. What is the output of the following C program?</b></span></p><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><p><span style="font-family: Consolas;">#include <stdio.h></span></p><p><span style="font-family: Consolas;">int main() {</span></p><p><span style="font-family: Consolas;"> char str1[] = "hello";</span></p><p><span style="font-family: Consolas;"> char str2[] = "world";</span></p><p><span style="font-family: Consolas;"> printf("%s", str1);</span></p><p><span style="font-family: Consolas;"> printf("%s", str2);</span></p><p><span style="font-family: Consolas;"> return 0;</span></p><p><span style="font-family: Consolas;">}</span></p><p><span style="font-family: Consolas;">A) helloworld</span></p><p><span style="font-family: Consolas;">B) hello world</span></p><p><span style="font-family: Consolas;">C) hello</span></p><p><span style="font-family: Consolas;"> world</span></p><p><span style="font-family: Consolas;">D) Compilation error</span></p></blockquote><p><span style="font-family: Consolas;"><br /></span></p><p><span style="color: #38761d; font-family: Open Sans;"><b>2. What is the output of the following C program?</b></span></p><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><p style="text-align: left;"><span style="font-family: Consolas;">#include <stdio.h></span></p><p style="text-align: left;"><span style="font-family: Consolas;">int main() {</span></p><p style="text-align: left;"><span style="font-family: Consolas;"> char str[] = "hello";</span></p><p style="text-align: left;"><span style="font-family: Consolas;"> printf("%c", str[3]);</span></p><p style="text-align: left;"><span style="font-family: Consolas;"> return 0;</span></p><p style="text-align: left;"><span style="font-family: Consolas;">}</span></p><p style="text-align: left;"><span style="font-family: Consolas;">A) h</span></p><p style="text-align: left;"><span style="font-family: Consolas;">B) e</span></p><p style="text-align: left;"><span style="font-family: Consolas;">C) l</span></p><p style="text-align: left;"><span style="font-family: Consolas;">D) o</span></p></blockquote><p><span style="font-family: Consolas;"><br /></span></p><p><b><span style="color: #38761d; font-family: Open Sans;">3. What is the output of the following C program?</span></b></p><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><p><span style="font-family: Consolas;">#include <stdio.h></span></p><p><span style="font-family: Consolas;">int main() {</span></p><p><span style="font-family: Consolas;"> char str1[] = "hello";</span></p><p><span style="font-family: Consolas;"> char str2[] = "world";</span></p><p><span style="font-family: Consolas;"> printf("%s", str1 + 3);</span></p><p><span style="font-family: Consolas;"> printf("%s", str2 + 1);</span></p><p><span style="font-family: Consolas;"> return 0;</span></p><p><span style="font-family: Consolas;">}</span></p><p><span style="font-family: Consolas;">A) loorld</span></p><p><span style="font-family: Consolas;">B) loorldw</span></p><p><span style="font-family: Consolas;">C) loworld</span></p><p><span style="font-family: Consolas;">D) helloworld</span></p></blockquote><p><span style="font-family: Consolas;"><br /></span></p><p><span style="color: #38761d; font-family: Open Sans;"><b>4. What is the output of the following C program?</b></span></p><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><p><span style="font-family: Consolas;">#include <stdio.h></span></p><p><span style="font-family: Consolas;">int main() {</span></p><p><span style="font-family: Consolas;"> char str[] = "hello";</span></p><p><span style="font-family: Consolas;"> str[2] = '\0';</span></p><p><span style="font-family: Consolas;"> printf("%s", str);</span></p><p><span style="font-family: Consolas;"> return 0;</span></p><p><span style="font-family: Consolas;">}</span></p><p><span style="font-family: Consolas;">A) hel</span></p><p><span style="font-family: Consolas;">B) he</span></p><p><span style="font-family: Consolas;">C) hello</span></p><p><span style="font-family: Consolas;">D) Compilation error</span></p></blockquote><p><span style="font-family: Consolas;"><br /></span></p><p><span style="color: #38761d; font-family: Open Sans;"><b>5. What is the output of the following C program?</b></span></p><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><p><span style="font-family: Consolas;">#include <stdio.h></span></p><p><span style="font-family: Consolas;">int main() {</span></p><p><span style="font-family: Consolas;"> int arr[] = {2, 3, 4};</span></p><p><span style="font-family: Consolas;"> int *p = arr;</span></p><p><span style="font-family: Consolas;"> printf("%d", *(p + 1));</span></p><p><span style="font-family: Consolas;"> return 0;</span></p><p><span style="font-family: Consolas;">}</span></p><p><span style="font-family: Consolas;">A) 2</span></p><p><span style="font-family: Consolas;">B) 3</span></p><p><span style="font-family: Consolas;">C) 4</span></p><p><span style="font-family: Consolas;">D) Compilation error</span></p></blockquote><p><span style="font-family: Consolas;"><br /></span></p><p><b><span style="color: #2b00fe; font-family: Open Sans;"><a href="https://cprogrampracticals.blogspot.com/2023/04/c-programming-predict-output-strings-set3-answer.html" target="_blank">Check ANSEWR here...</a></span></b></p><div class="separator" style="clear: both; text-align: center;"><a href="https://cprogrampracticals.blogspot.com/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="34" data-original-width="102" height="34" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkiM9B0AK8yP7q0Lrrr3RpnRfvfrSdnXlGlv8vVpJPeTVQwcW7P9Jmq2arO5kAl_JYWrZcBWH133eo6X8Gcfbv5YG15VqDwZW3Zo4Z1Bc11x54wNabG_8x0ZH2U2TrC_9haWI2JDLzYIfUdqX1khj2i_x3dweTS_tTQDYrFQg94E72NvrgHcuKgsnEbw/s1600/button_home.png" width="102" /></a></div><br /><p><br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-22602900952093341192023-03-15T10:27:00.000+05:302023-03-15T10:27:05.249+05:30C program to decrypt a text file using Caesar Cipher<h3 style="text-align: left;"><span style="color: #660000; font-family: Open Sans;">Caesar Cipher File Decryptor</span></h3><div><span style="font-family: Open Sans;"><br /></span></div><span style="font-family: Open Sans;">This C program will decrypt a given text file into plain text file using Caesar Cipher cryptographic algorithm.</span><div><br /></div><div><br /></div>
<div style="background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #557799;">#include <stdio.h></span>
<span style="color: #557799;">#define MAX_FILE_SIZE 1000</span>
<br /></pre><pre style="line-height: 125%; margin: 0px;">//function to decrypt message based on given key</pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #333399; font-weight: bold;">void</span> <span style="color: #0066bb; font-weight: bold;">decrypt</span>(<span style="color: #333399; font-weight: bold;">char</span> <span style="color: #333333;">*</span>message, <span style="color: #333399; font-weight: bold;">int</span> key) {
<span style="color: #333399; font-weight: bold;">char</span> ch;
<span style="color: #333399; font-weight: bold;">int</span> i;
<span style="color: #008800; font-weight: bold;">for</span>(i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; message[i] <span style="color: #333333;">!=</span> <span style="color: #0044dd;">'\0'</span>; <span style="color: #333333;">++</span>i){
ch <span style="color: #333333;">=</span> message[i];
<span style="color: #008800; font-weight: bold;">if</span>(ch <span style="color: #333333;">>=</span> <span style="color: #0044dd;">'a'</span> <span style="color: #333333;">&&</span> ch <span style="color: #333333;"><=</span> <span style="color: #0044dd;">'z'</span>){
ch <span style="color: #333333;">=</span> ch <span style="color: #333333;">-</span> key;
<span style="color: #008800; font-weight: bold;">if</span>(ch <span style="color: #333333;"><</span> <span style="color: #0044dd;">'a'</span>){
ch <span style="color: #333333;">=</span> ch <span style="color: #333333;">+</span> <span style="color: #0044dd;">'z'</span> <span style="color: #333333;">-</span> <span style="color: #0044dd;">'a'</span> <span style="color: #333333;">+</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
}
message[i] <span style="color: #333333;">=</span> ch;
}
<span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span>(ch <span style="color: #333333;">>=</span> <span style="color: #0044dd;">'A'</span> <span style="color: #333333;">&&</span> ch <span style="color: #333333;"><=</span> <span style="color: #0044dd;">'Z'</span>){
ch <span style="color: #333333;">=</span> ch <span style="color: #333333;">-</span> key;
<span style="color: #008800; font-weight: bold;">if</span>(ch <span style="color: #333333;"><</span> <span style="color: #0044dd;">'A'</span>){
ch <span style="color: #333333;">=</span> ch <span style="color: #333333;">+</span> <span style="color: #0044dd;">'Z'</span> <span style="color: #333333;">-</span> <span style="color: #0044dd;">'A'</span> <span style="color: #333333;">+</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
}
message[i] <span style="color: #333333;">=</span> ch;
}
}
}
<span style="color: #333399; font-weight: bold;">int</span> <span style="color: #0066bb; font-weight: bold;">main</span>() {
<span style="color: #333399; font-weight: bold;">FILE</span> <span style="color: #333333;">*</span>fileIn, <span style="color: #333333;">*</span>fileOut;
<span style="color: #333399; font-weight: bold;">char</span> message[MAX_FILE_SIZE];
<span style="color: #333399; font-weight: bold;">int</span> key;
<span style="color: #888888;">// Open the encrypted file</span>
fileIn <span style="color: #333333;">=</span> fopen(<span style="background-color: #fff0f0;">"demo1.txt"</span>, <span style="background-color: #fff0f0;">"r"</span>);
<span style="color: #008800; font-weight: bold;">if</span>(fileIn <span style="color: #333333;">==</span> <span style="color: #007020;">NULL</span>){
printf(<span style="background-color: #fff0f0;">"File open error.</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>);
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
<span style="color: #888888;">// Read the encrypted message from given file</span>
fgets(message, MAX_FILE_SIZE, fileIn);
<span style="color: #888888;">// Close the input file</span>
fclose(fileIn);
<span style="color: #888888;">// Prompt user to enter the key</span>
printf(<span style="background-color: #fff0f0;">"Enter key: "</span>);
scanf(<span style="background-color: #fff0f0;">"%d"</span>, <span style="color: #333333;">&</span>key);
<span style="color: #888888;">// Decrypt the message</span>
decrypt(message, key);
<span style="color: #888888;">// Open the output file</span>
fileOut <span style="color: #333333;">=</span> fopen(<span style="background-color: #fff0f0;">"decrypted.txt"</span>, <span style="background-color: #fff0f0;">"w"</span>);
<span style="color: #008800; font-weight: bold;">if</span>(fileOut <span style="color: #333333;">==</span> <span style="color: #007020;">NULL</span>){
printf(<span style="background-color: #fff0f0;">"File write error.</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>);
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
<span style="color: #888888;">// Write the decrypted message to output file</span>
fprintf(fileOut, <span style="background-color: #fff0f0;">"%s"</span>, message);
<span style="color: #888888;">// Close the output file</span>
fclose(fileOut);
printf(<span style="background-color: #fff0f0;">"File decrypted successfully.</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>);
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
</pre></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-29612153007639759232023-02-23T10:43:00.003+05:302023-11-02T11:53:03.655+05:30C File Management Important MCQs<h3 style="text-align: left;">
<span style="color: #660000; font-family: verdana;"
>C Programming File Management Important MCQs</span
>
</h3>
<div>
<span style="color: #660000; font-family: verdana;"><br /></span>
</div>
<p>
<span style="font-family: verdana;"
>1. Which function is used to <b>open a file</b> in C programming
language?</span
>
</p>
<p><span style="font-family: verdana;">(a) fopen()</span></p>
<p><span style="font-family: verdana;">(b) open()</span></p>
<p><span style="font-family: verdana;">(c) read()</span></p>
<p><span style="font-family: verdana;">(d) close()</span></p>
<p><br /></p>
<p>
<span style="font-family: verdana;"
>2. What is the correct syntax of the <b>fopen()</b> function?</span
>
</p>
<p><span style="font-family: verdana;">(a) fopen("filename", "mode");</span></p>
<p><span style="font-family: verdana;">(b) fopen("mode", "filename");</span></p>
<p>
<span style="font-family: verdana;">(c) fopen("filename", "access");</span>
</p>
<p>
<span style="font-family: verdana;">(d) fopen("access", "filename");</span>
</p>
<p><br /></p>
<p>
<span style="font-family: verdana;"
>3. Which mode is used <b>to open a file</b> for <b>reading </b>in C
programming language?</span
>
</p>
<p><span style="font-family: verdana;">(a) r</span></p>
<p><span style="font-family: verdana;">(b) w</span></p>
<p><span style="font-family: verdana;">(c) a</span></p>
<p><span style="font-family: verdana;">(d) x</span></p>
<p><br /></p>
<p>
<span style="font-family: verdana;"
>4. Which mode is used <b>to</b> <b>open a file</b> for <b>writing </b>in C
programming language?</span
>
</p>
<p><span style="font-family: verdana;">(a) r</span></p>
<p><span style="font-family: verdana;">(b) w</span></p>
<p><span style="font-family: verdana;">(c) a</span></p>
<p><span style="font-family: verdana;">(d) x</span></p>
<p><br /></p>
<p>
<span style="font-family: verdana;"
>5. What is the syntax of the fclose() function?</span
>
</p>
<p><span style="font-family: verdana;">(a) fclose();</span></p>
<p><span style="font-family: verdana;">(b) fclose(file);</span></p>
<p><span style="font-family: verdana;">(c) fclose("filename");</span></p>
<p><span style="font-family: verdana;">(d) fclose(filename);</span></p>
<p><br /></p>
<p>
<span style="font-family: verdana;"
>6. Find the purpose of the <b>fseek() </b>function in C File
Management.</span
>
</p>
<p>
<span style="font-family: verdana;"
>(a) To move the file pointer to a specific position in the file</span
>
</p>
<p><span style="font-family: verdana;">(b) To close a file</span></p>
<p><span style="font-family: verdana;">(c) To read a file</span></p>
<p><span style="font-family: verdana;">(d) To write to a file</span></p>
<p><br /></p>
<p>
<span style="font-family: verdana;"
>7. What is the purpose of the <b>remove() </b>function in C File
Management?</span
>
</p>
<p><span style="font-family: verdana;">(a) To rename a file</span></p>
<p><span style="font-family: verdana;">(b) To delete a file</span></p>
<p><span style="font-family: verdana;">(c) To create a new file</span></p>
<p><span style="font-family: verdana;">(d) To close a file</span></p>
<p>
<span style="font-family: verdana;"><br /></span>
</p>
<p>
<span style="font-family: verdana;"
>8. What is the syntax for opening a file in C programming?</span
>
</p>
<div>
<p>
<span style="font-family: verdana;"
>(a) FILE *fp = fopen("filename", "mode");</span
>
</p>
<p>
<span style="font-family: verdana;"
>(b) file fp = fopen("filename", "mode");</span
>
</p>
<p>
<span style="font-family: verdana;"
>(c) FILE *fp = fopen("mode", "filename");</span
>
</p>
<p><span style="font-family: verdana;">(d) none of these</span></p>
<p>
<span style="font-family: verdana;">< </span
><span style="font-family: verdana; font-size: medium;"
><b
><span style="color: #2b00fe;"
><a
href="https://cprogrampracticals.blogspot.com/2023/02/file-management-mcqs-with-answers.html"
target="_blank"
>Check your ANSWER Here</a
></span
></b
> </span
><span style="font-family: verdana;">></span>
</p>
</div>
<div><br /></div>
<div align="center">
<script
async=""
src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
></script>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a
href="https://cprogrampracticals.blogspot.com/"
style="margin-left: 1em; margin-right: 1em;"
><img
border="0"
data-original-height="34"
data-original-width="102"
height="34"
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx7XIvlZ_6OGt_QoBYweItxjCRNALblRbC7VvlkaFhTk8IubIMGj9EZttybTebiFnyc4PWlvK6q85ky-OF2DTIfW45rxEJ_knnDTU2EjEmehdC0bKw9Pzmpil3lidQZ-ta5cOryVl2SUouMqPh1hhwRudsh2soDogkbC4NApeRhkEQu8rr2Dyv5cm-WQ/s1600/button_home.png"
width="102"
/></a>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-46105333118807886482023-02-23T10:36:00.003+05:302023-11-02T12:01:32.129+05:30File Management MCQs with Answers<h3 style="text-align: left;">
<span style="color: #660000; font-family: verdana;"
>C Programming File Management Important MCQs with Answers</span
>
</h3>
<p>
<span style="font-family: verdana;"
>1. Which function is used to <b>open a file</b> in C programming
language?</span
>
</p>
<p><span style="font-family: verdana;">(a) fopen()</span></p>
<p><span style="font-family: verdana;">(b) open()</span></p>
<p><span style="font-family: verdana;">(c) read()</span></p>
<p><span style="font-family: verdana;">(d) close()</span></p>
<p>
<span style="font-family: verdana;"
><b>Answer:</b>
<span style="color: #38761d;"><b>(a) fopen()</b></span></span
>
</p>
<p>
<span style="font-family: verdana;"><br /></span>
</p>
<p>
<span style="font-family: verdana;"
>2. What is the correct syntax of the <b>fopen()</b> function?</span
>
</p>
<p><span style="font-family: verdana;">(a) fopen("filename", "mode");</span></p>
<p><span style="font-family: verdana;">(b) fopen("mode", "filename");</span></p>
<p>
<span style="font-family: verdana;">(c) fopen("filename", "access");</span>
</p>
<p>
<span style="font-family: verdana;">(d) fopen("access", "filename");</span>
</p>
<p>
<span style="font-family: verdana;"
><b>Answer:</b>
<span style="color: #38761d;"
><b>(a) fopen("filename", "mode");</b></span
></span
>
</p>
<p>
<span style="font-family: verdana;"><br /></span>
</p>
<p>
<span style="font-family: verdana;"
>3. Which mode is used <b>to open a file</b> for <b>reading </b>in C
programming language?</span
>
</p>
<p><span style="font-family: verdana;">(a) r</span></p>
<p><span style="font-family: verdana;">(b) w</span></p>
<p><span style="font-family: verdana;">(c) a</span></p>
<p><span style="font-family: verdana;">(d) x</span></p>
<p>
<span style="font-family: verdana;"
><b>Answer:</b> <b><span style="color: #38761d;">(a) r</span></b></span
>
</p>
<p>
<span style="font-family: verdana;"><br /></span>
</p>
<p>
<span style="font-family: verdana;"
>4. Which mode is used <b>to</b> <b>open a file</b> for <b>writing </b>in C
programming language?</span
>
</p>
<p><span style="font-family: verdana;">(a) r</span></p>
<p><span style="font-family: verdana;">(b) w</span></p>
<p><span style="font-family: verdana;">(c) a</span></p>
<p><span style="font-family: verdana;">(d) x</span></p>
<p>
<span style="font-family: verdana;"
><b>Answer: <span style="color: #38761d;">(b) w</span></b></span
>
</p>
<p>
<span style="font-family: verdana;"><br /></span>
</p>
<p>
<span style="font-family: verdana;"
>5. What is the syntax of the fclose() function?</span
>
</p>
<p><span style="font-family: verdana;">(a) fclose();</span></p>
<p><span style="font-family: verdana;">(b) fclose(file);</span></p>
<p><span style="font-family: verdana;">(c) fclose("filename");</span></p>
<p><span style="font-family: verdana;">(d) fclose(filename);</span></p>
<p>
<span style="font-family: verdana;"
><b>Answer: <span style="color: #38761d;">(b) fclose(file);</span></b></span
>
</p>
<p>
<span style="font-family: verdana;"><br /></span>
</p>
<p>
<span style="font-family: verdana;"
>6. Find the purpose of the <b>fseek() </b>function in C File
Management.</span
>
</p>
<p>
<span style="font-family: verdana;"
>(a) To move the file pointer to a specific position in the file</span
>
</p>
<p><span style="font-family: verdana;">(b) To close a file</span></p>
<p><span style="font-family: verdana;">(c) To read a file</span></p>
<p><span style="font-family: verdana;">(d) To write to a file</span></p>
<p>
<span style="font-family: verdana;"
><b
>Answer:
<span style="color: #38761d;"
>(a) To move the file pointer to a specific position in the file</span
></b
></span
>
</p>
<p>
<span style="font-family: verdana;"><br /></span>
</p>
<p>
<span style="font-family: verdana;"
>7. What is the purpose of the <b>remove() </b>function in C File
Management?</span
>
</p>
<p><span style="font-family: verdana;">(a) To rename a file</span></p>
<p><span style="font-family: verdana;">(b) To delete a file</span></p>
<p><span style="font-family: verdana;">(c) To create a new file</span></p>
<p><span style="font-family: verdana;">(d) To close a file</span></p>
<p>
<span style="font-family: verdana;"
><b
>Answer: <span style="color: #38761d;">(b) To delete a file</span></b
></span
>
</p>
<div><br /></div>
<div>
<p>
<span style="font-family: verdana;"
>8. What is the syntax for opening a file in C programming?</span
>
</p>
<p>
<span style="font-family: verdana;"
>(a) FILE *fp = fopen("filename", "mode");</span
>
</p>
<p>
<span style="font-family: verdana;"
>(b) file fp = fopen("filename", "mode");</span
>
</p>
<p>
<span style="font-family: verdana;"
>(c) FILE *fp = fopen("mode", "filename");</span
>
</p>
<p><span style="font-family: verdana;">(d) none of these</span></p>
<p>
<span style="font-family: verdana;"
><b>Answer: <span style="color: #38761d;">(a) </span></b></span
><span style="color: #38761d; font-family: verdana;"
><b>FILE *fp = fopen("filename", "mode");</b></span
>
</p>
<div><br /></div>
</div>
<div><br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a
href="https://cprogrampracticals.blogspot.com/"
style="margin-left: 1em; margin-right: 1em;"
><img
border="0"
data-original-height="34"
data-original-width="102"
height="34"
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx7XIvlZ_6OGt_QoBYweItxjCRNALblRbC7VvlkaFhTk8IubIMGj9EZttybTebiFnyc4PWlvK6q85ky-OF2DTIfW45rxEJ_knnDTU2EjEmehdC0bKw9Pzmpil3lidQZ-ta5cOryVl2SUouMqPh1hhwRudsh2soDogkbC4NApeRhkEQu8rr2Dyv5cm-WQ/s1600/button_home.png"
width="102"
/></a>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-62213648883988104182023-02-15T22:01:00.003+05:302023-02-15T22:01:59.192+05:30Comparison between Python, C and Java<div style="text-align: justify;"><span style="font-family: "Open Sans";">This article provides comparison between three most popular computer programming languages: <b><i>Python, C </i></b>and <b><i>Java</i></b>.</span></div><span style="font-family: Open Sans;"><div style="text-align: justify;"><br /></div><h2 style="text-align: justify;"><span style="color: #660000;">Python, C and Java</span></h2><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Python, C, and Java are three different programming languages. Each language has its own strengths and weaknesses. Following is a short comparison of these three computer programming languages:</div><div style="text-align: justify;"><br /></div><h3 style="text-align: justify;"><span style="color: #38761d;"><u>Python</u></span></h3><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Python is a high-level, interpreted language that is known for its simplicity, readability, and versatility. It has a vast standard library, and it is often used for scripting, web development, data analysis, machine learning, and artificial intelligence. It is dynamically typed, which means that variables don't need to be explicitly declared, and it has a simple syntax that makes it easy to learn and use.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><ul><li><b><span style="color: #2b00fe;">Pros: </span></b>Easy to learn, concise and readable syntax, large standard library, dynamic typing, strong support for scientific computing and data analysis, good for scripting and automation tasks.</li></ul></div><div style="text-align: justify;"><ul><li><b><span style="color: red;">Cons:</span></b> Slower compared to other compiled languages, not the best option for low-level programming, doesn't offer as much control over memory management, and not ideal for developing large-scale applications.</li></ul></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><span style="color: #38761d;"><b><u>C Language</u></b></span></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">C is a low-level language that is used for system programming, embedded systems, and other tasks that require direct access to hardware. It is a compiled language, which means that it is translated into machine code by a compiler before being executed. C is known for its efficiency, control over memory management, and low-level access to system resources.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><ul><li><b><span style="color: #2b00fe;">Pros:</span></b> Fast and efficient, direct access to system resources, control over memory management, widely used in system programming and embedded systems.</li><li><span style="color: red;"><b>Cons:</b></span> Complex syntax, difficult to learn, no built-in support for object-oriented programming, no automatic garbage collection, prone to memory leaks and buffer overflows.</li></ul></div><div style="text-align: justify;"><br /></div><h3 style="text-align: justify;"><span style="color: #38761d;"><u>Java</u></span></h3><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Java is a high-level language that is known for its portability, security, and object-oriented programming features. It is compiled into bytecode, which is then interpreted by the Java Virtual Machine (JVM). Java is used for a wide range of applications, including web development, mobile app development, and enterprise software.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><ul><li><b><span style="color: #2b00fe;">Pros:</span></b> Platform independence, strong support for object-oriented programming, automatic memory management, rich standard library, good for developing large-scale applications.</li><li><span style="color: red;"><b>Cons:</b></span> Slower compared to other compiled languages, requires the JVM to be installed on the system, more verbose syntax than Python, and requires more memory compared to other languages.</li></ul></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><b><u>Summary:</u></b></div></span><div><div style="text-align: justify;"><span style="font-family: "Open Sans";"><br /></span></div><span style="font-family: Open Sans;"><div style="text-align: justify;">In summary, each language has its own strengths and weaknesses, and the choice of language depends on the specific requirements of the project. Python is often used for scripting and data analysis, C is used for system programming and embedded systems, and Java is used for enterprise software and mobile app development.</div></span></div><div style="text-align: justify;"><span style="font-family: Open Sans;"><br /></span></div><div style="text-align: justify;"><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://cprogrampracticals.blogspot.com/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="34" data-original-width="102" height="34" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx7XIvlZ_6OGt_QoBYweItxjCRNALblRbC7VvlkaFhTk8IubIMGj9EZttybTebiFnyc4PWlvK6q85ky-OF2DTIfW45rxEJ_knnDTU2EjEmehdC0bKw9Pzmpil3lidQZ-ta5cOryVl2SUouMqPh1hhwRudsh2soDogkbC4NApeRhkEQu8rr2Dyv5cm-WQ/s1600/button_home.png" width="102" /></a></div>
</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-91640025577470356552022-12-31T23:42:00.005+05:302022-12-31T23:44:42.360+05:30C program to print Memory Address of a variable<p><span style="font-family: Overpass;">In C program, we use variables to store some value. Value of any variables are stored in a memory.</span></p><div><span style="font-family: Overpass;">We can print memory address using following two methods:</span></div><div><ul><li><span style="font-family: Overpass;">By using <b>address of</b> (&) operator</span></li><li><span style="font-family: Overpass;">By using <b>pointer </b>variable</span></li></ul><div><div><span style="font-family: Overpass;"><b> "%p"</b> is a format specifier to print a memory address in C language.</span></div><div></div></div></div><p><span style="font-family: Overpass;">Let's see a program to print a memory address of a variable.</span></p><p><br /></p>
<div style="background: rgb(240, 240, 240); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #007020;">#include<stdio.h></span>
<span style="color: #902000;">int</span> <span style="color: #06287e;">main</span>(){
<span style="color: #902000;">int</span> number<span style="color: #666666;">=</span><span style="color: #40a070;">5</span>;
<span style="color: #902000;">float</span> percen <span style="color: #666666;">=</span> <span style="color: #40a070;">80.5</span>;
printf(<span style="color: #4070a0;">"Memory address of number variable: %p </span><span style="color: #4070a0; font-weight: bold;">\n</span><span style="color: #4070a0;">"</span>, <span style="color: #666666;">&</span>number);
printf(<span style="color: #4070a0;">"Memory address of percen variable: %p"</span>, <span style="color: #666666;">&</span>percen);
<span style="color: #007020; font-weight: bold;">return</span> <span style="color: #40a070;">0</span>;
}
</pre></div>
<div><br /></div><span style="color: #660000; font-family: Overpass;"><b>Output of Program</b></span><div><span style="font-family: Overpass;"><br /></span></div><div><div><span style="font-family: Consolas;">Memory address of number variable: 000000051FE1C</span></div><div><span style="font-family: Consolas;">Memory address of percen variable: 000000051FE18</span></div><div><span style="font-family: Overpass;"><br /></span></div><div><span style="color: #660000; font-family: Overpass;"><b>Note:</b></span></div><div><span style="font-family: Overpass;"><br /></span></div><div><span style="font-family: Overpass;">You will get different memory address as output in your program execution.</span></div><div><span style="font-family: Overpass;"><span style="background-color: white; font-family: "segoe ui", "open sans", sans-serif; font-size: 16px;">At every run your output may change.</span></span></div><div><br /></div><div><br /></div><div><div><br /></div></div><div><br /></div><div><br /></div>
<div class="separator" style="clear: both; text-align: center;"><a href="https://cprogrampracticals.blogspot.com/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="34" data-original-width="102" height="34" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx7XIvlZ_6OGt_QoBYweItxjCRNALblRbC7VvlkaFhTk8IubIMGj9EZttybTebiFnyc4PWlvK6q85ky-OF2DTIfW45rxEJ_knnDTU2EjEmehdC0bKw9Pzmpil3lidQZ-ta5cOryVl2SUouMqPh1hhwRudsh2soDogkbC4NApeRhkEQu8rr2Dyv5cm-WQ/s1600/button_home.png" width="102" /></a></div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-1739719966804353932022-06-28T14:41:00.004+05:302023-11-02T12:04:00.780+05:30Palindrome numbers between give range<p><span style="font-family: Open Sans; font-size: medium;">This program will print list of palindrome numbers between given range. </span></p>
<div style="background: rgb(248, 248, 248); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;">// C Program to Generate palindrome numbers in a given range of numbers.</span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800;">#include<stdio.h></span>
<span style="color: #00bb00; font-weight: bold;"><br /></span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #00bb00; font-weight: bold;">int</span> <span style="color: #00a000;">main</span>(){
<span style="color: #00bb00; font-weight: bold;">int</span> i, start, end, rem, rev_num, temp;
printf(<span style="color: #bb4444;">"Enter first number (lower limit): "</span>);
scanf(<span style="color: #bb4444;">"%d"</span>,<span style="color: #666666;">&</span>start);
printf(<span style="color: #bb4444;">"Enter last number (upper limit): "</span>);
scanf(<span style="color: #bb4444;">"%d"</span>,<span style="color: #666666;">&</span>end);
printf(<span style="color: #bb4444;">"List of Palindrome numbers between %d - %d: "</span>,start, end);
<span style="color: #aa22ff; font-weight: bold;">for</span>(i<span style="color: #666666;">=</span>start; i<span style="color: #666666;"><=</span>end; i<span style="color: #666666;">++</span>)
{
temp <span style="color: #666666;">=</span> i;
rev_num<span style="color: #666666;">=0</span>;
<span style="color: #aa22ff; font-weight: bold;">while</span>(temp){
rem <span style="color: #666666;">=</span> temp<span style="color: #666666;">%10</span>;
temp <span style="color: #666666;">=</span> temp<span style="color: #666666;">/10</span>;
rev_num <span style="color: #666666;">=</span> rev_num<span style="color: #666666;">*10</span> <span style="color: #666666;">+</span> rem;
}
<span style="color: #aa22ff; font-weight: bold;">if</span>(i <span style="color: #666666;">==</span> rev_num)
printf(<span style="color: #bb4444;">"%d "</span>, i);
}
<span style="color: #aa22ff; font-weight: bold;">return</span> <span style="color: #666666;">0</span>;
}
<span style="color: #008800; font-style: italic;"><br /></span></pre><pre style="line-height: 125%; margin: 0px;"><span style="font-family: Open Sans;"><b>Output of program</b></span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #008800; font-style: italic;">Enter first number (lower limit): 80</span>
<span style="color: #008800; font-style: italic;">Enter last number (upper limit): 150</span>
<span style="color: #008800; font-style: italic;">List of Palindrome numbers between 70 - 200: 88 99 101 111 121 131 141</span>
</pre></div>
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://cprogrampracticals.blogspot.com/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="34" data-original-width="102" height="34" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx7XIvlZ_6OGt_QoBYweItxjCRNALblRbC7VvlkaFhTk8IubIMGj9EZttybTebiFnyc4PWlvK6q85ky-OF2DTIfW45rxEJ_knnDTU2EjEmehdC0bKw9Pzmpil3lidQZ-ta5cOryVl2SUouMqPh1hhwRudsh2soDogkbC4NApeRhkEQu8rr2Dyv5cm-WQ/s1600/button_home.png" width="102" /></a></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-5634250541658505062022-05-31T14:23:00.007+05:302022-05-31T14:34:45.898+05:30Flowchart to print Series of Numbers divisible by 3<p><span style="color: #660000; font-family: Open Sans; font-size: medium;"><b>Draw a flowchart to print Series of Numbers divisible by 3:</b></span></p><p><span style="color: #274e13; font-family: Open Sans; font-size: medium;"><b>2178 726 242 81 27 9 3 1 </b></span></p><p><span style="font-family: Open Sans; font-size: medium;"><b>Logic:</b> </span></p><p></p><ul style="text-align: left;"><li><span style="font-family: Open Sans; font-size: medium;">Step 1: Read a starting number which is divisible by 3</span></li><li><span style="font-family: Open Sans; font-size: medium;">Step 2: Divide current number by 3 to get a next number</span></li><li><span style="font-family: Open Sans; font-size: medium;">Step 3: Repeat Step 2 until you get a number 1. </span></li></ul><span style="font-family: "Open Sans"; font-size: medium;">Following flowchart is prepared using a <a href="https://cprogrampracticals.blogspot.com/p/raptor.html" target="_blank"><b>Raptor </b></a>Tool.</span><p></p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhclbzTxQ1rTjHe_IKhzZhs0AOvEnR-ElWCXzW-N9tDwRbG-jYgGVmffmuNhEB3yJfouMy1eCdC-Jd5uLsCcyt-123nABdH58DuSMhdb-zlJvHawnV0pLhG0EiHfg5F-FVcbOT60ZbOjtf0zIFvL8f0kM62AiTY8hNsvi7EbrixMxe9aPVvL9Wbx4STxw/s601/Flowchart-to-print-series-of-numbers.png" style="margin-left: auto; margin-right: auto;"><span style="font-family: Open Sans; font-size: medium;"><img alt="Flowchart to print series of numbers divisible by 3" border="0" data-original-height="601" data-original-width="291" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhclbzTxQ1rTjHe_IKhzZhs0AOvEnR-ElWCXzW-N9tDwRbG-jYgGVmffmuNhEB3yJfouMy1eCdC-Jd5uLsCcyt-123nABdH58DuSMhdb-zlJvHawnV0pLhG0EiHfg5F-FVcbOT60ZbOjtf0zIFvL8f0kM62AiTY8hNsvi7EbrixMxe9aPVvL9Wbx4STxw/s16000/Flowchart-to-print-series-of-numbers.png" title="Flowchart to print series of numbers divisible by 3" /></span></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Open Sans; font-size: medium;">Figure: Flowchart to print series of numbers divisible by 3</span></td></tr></tbody></table><p><span style="font-family: Open Sans; font-size: medium;"><br /></span></p><p style="text-align: justify;"><span style="font-family: Open Sans; font-size: medium;">This Raptor flowchart also uses a CEILING function. In Raptor, </span><span style="font-family: "Open Sans"; font-size: medium;">CEILING </span><span style="font-family: Open Sans; font-size: medium;">returns the lowest integer value greater than or equal to the provided argument. </span></p><p><span style="font-family: Open Sans; font-size: medium;">For example, </span></p><p></p><ul style="text-align: left;"><li><span style="font-size: medium;"><span style="font-family: "Open Sans";"><b>CEILING</b></span><span style="font-family: Open Sans;"><b>(15.8)</b> is <b>16</b> </span></span></li><li><span style="font-size: medium;"><span style="font-family: "Open Sans";"><b>CEILING</b></span><span style="font-family: Open Sans;"><b>(3.2) </b>is <b>4</b> </span></span></li><li><span style="font-size: medium;"><span style="font-family: "Open Sans";"><b>CEILING</b></span><span style="font-family: Open Sans;"><b>(- 4.2) </b>is <b>- 4</b></span></span></li></ul><p><span style="font-family: Open Sans; font-size: medium;"><span style="color: #333333;">You may like to visit following top 10 flowcharts.</span><br style="background-color: white; color: #333333;" /></span></p><ul style="background-color: white; color: #333333; line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;"><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/06/flowchart-to-check-positive-number.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Open Sans; font-size: medium;">Flowchart to check positive number.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/06/flowchart-to-check-negative-number.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Open Sans; font-size: medium;">Flowchart to check negative number.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/06/flowchart-to-check-odd-or-even-number.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Open Sans; font-size: medium;">Flowchart to check Odd or Even number.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/06/draw-flowchart-to-display-good-morning.html" style="color: #33aaff; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Open Sans; font-size: medium;">Flowchart to display Good morning message based on given time.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/09/flowchart-to-print-to-z.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Open Sans; font-size: medium;">Flowchart to print A to Z.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/09/flowchart-to-print-10-9-8-1-using.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Open Sans; font-size: medium;">Flowchart to print 10, 9, ......, 1.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2017/04/flowchart-to-add-two-numbers.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Open Sans; font-size: medium;">Flowchart to Add two numbers.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2017/04/flowchart-to-subtract-two-numbers.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Open Sans; font-size: medium;">Flowchart to subtract two numbers.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2017/04/flowchart-to-print-area-of-square.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Open Sans; font-size: medium;">Flowchart to print area of square.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2017/04/flowchart-to-print-area-of-rectangle.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Open Sans; font-size: medium;">Flowchart to print area of rectangle.</span></span></a></li></ul><p><br /></p><div class="separator" style="clear: both; text-align: center;"><a href="https://cprogrampracticals.blogspot.com/p/flowchart.html" style="margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" data-original-height="40" data-original-width="218" height="40" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTm4TAg_OI5lmlWVdrMONp-umAqEDYz2zZrmCaqYCRVGS5JQGmDpSJjexpBu44ljOKBoLONwnFjkRfy6mkGvrRjCcVjyCzwDS1-y-IWI_PNPYM7y-NfCr-bDmcQ4Vh8R1nUGd3kOiqrIUFWcCQpbdEz16nYVoDGYGBptIIpcr8cgTP0YPsMjybqA0aIw/s1600/button_flowchart.png" width="218" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://cprogrampracticals.blogspot.com/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="34" data-original-width="102" height="34" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx7XIvlZ_6OGt_QoBYweItxjCRNALblRbC7VvlkaFhTk8IubIMGj9EZttybTebiFnyc4PWlvK6q85ky-OF2DTIfW45rxEJ_knnDTU2EjEmehdC0bKw9Pzmpil3lidQZ-ta5cOryVl2SUouMqPh1hhwRudsh2soDogkbC4NApeRhkEQu8rr2Dyv5cm-WQ/s1600/button_home.png" width="102" /></a></div><br /><p><br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-9527055168162316002022-04-09T17:18:00.001+05:302023-11-02T12:07:22.888+05:30C program to create an array of student names<h3 style="text-align: left;">
<span style="font-family: Open Sans;"
>This program is based on C programming String and an Array concept.</span
>
</h3>
<div>
<span style="font-family: Open Sans;"><br /></span>
</div>
<h4 style="text-align: left;">
<span style="color: #660000; font-family: Open Sans;"
>Problem definition: Write a C program to create an array of student
names.</span
>
</h4>
<div
style="background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"
>
<pre
style="line-height: 125%; margin: 0px;"
><span style="color: #888888;"><b>//C Program to create an array of student names</b></span>
<span style="color: #557799;"><br /></span></pre>
<pre
style="line-height: 125%; margin: 0px;"
><span style="color: #557799;">#include<stdio.h></span>
<span style="color: #333399; font-weight: bold;">int</span> <span style="color: #0066bb; font-weight: bold;">main</span>(){
<span style="color: #333399; font-weight: bold;">char</span> name[<span style="color: #0000dd; font-weight: bold;">5</span>][<span style="color: #0000dd; font-weight: bold;">20</span>];
<span style="color: #888888;">//This can store 5 names; maximum 20 characters in each name</span>
<span style="color: #333399; font-weight: bold;">int</span> i;
<span style="color: #888888;">//Logic to Read name of 5 students</span>
<span style="color: #008800; font-weight: bold;">for</span>(i<span style="color: #333333;">=</span><span style="color: #0000dd; font-weight: bold;">0</span>; i<span style="color: #333333;"><</span><span style="color: #0000dd; font-weight: bold;">5</span>; i<span style="color: #333333;">++</span>){
printf(<span style="background-color: #fff0f0;">"Enter name %d:"</span>, i<span style="color: #333333;">+</span><span style="color: #0000dd; font-weight: bold;">1</span>);
gets(name[i]);
}
printf(<span style="background-color: #fff0f0;">"List of student names stored: </span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>);
<span style="color: #888888;">//Logic to print name of 5 students</span>
<span style="color: #008800; font-weight: bold;">for</span>(i<span style="color: #333333;">=</span><span style="color: #0000dd; font-weight: bold;">0</span>; i<span style="color: #333333;"><</span><span style="color: #0000dd; font-weight: bold;">5</span>; i<span style="color: #333333;">++</span>){
printf(<span style="background-color: #fff0f0;">"%s </span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>, name[i]);
}
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
<span style="color: #888888;"><br /></span></pre>
<pre
style="line-height: 125%; margin: 0px;"
><span style="color: #38761d; font-family: Roboto;"><b>Output of the program</b></span></pre>
<pre
style="line-height: 125%; margin: 0px;"
><span style="color: #888888;"><br /></span></pre>
<pre style="line-height: 125%; margin: 0px;"><span>Enter name 1:Amit</span>
<span>Enter name 2:Sunit</span>
<span>Enter name 3:Kamlesh</span>
<span>Enter name 4:Bhargav</span>
<span>Enter name 5:Alpesh</span>
<span>List of student names stored:</span>
<span>Amit</span>
<span>Sunit</span>
<span>Kamlesh</span>
<span>Bhargav</span>
<span>Alpesh</span>
</pre>
</div>
<div style="text-align: center;">* * *</div>
<div class="separator" style="clear: both; text-align: center;">
<a
href="https://cprogrampracticals.blogspot.com/p/c-string-programs.html"
imageanchor="1"
style="margin-left: 1em; margin-right: 1em;"
><img
border="0"
data-original-height="40"
data-original-width="186"
height="40"
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidzt12JPLk7_y5Cq1Pt7Vi50Daac6CJk4RO9mEVYNp2zQQ9cBNg4ml8h-f_5XxIIYO0rEOA5pf4WIsdGCgP18MRuUXd4o7IbWwndL5HF4NUymA_ISITZ48RmBykE5V2HuSQEo06_rsiJ67_MTxelgLxVvV0q91gPbbDY99EDeN0lzVy_8AqNsT5ABKjw/s1600/button_strings.png"
width="186"
/></a>
</div>
<div class="separator" style="clear: both; text-align: center;"><br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a
href="https://cprogrampracticals.blogspot.com/"
imageanchor="1"
style="margin-left: 1em; margin-right: 1em;"
><img
border="0"
data-original-height="34"
data-original-width="102"
height="34"
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA245_LHpnPYVfEYcze_K6pZl3Cqk73vH3l-e1R_nIL91mcvUqPluJEdhm7EIgY4trAeM9dyrMrJdyA-mMaJ-DSPaIdPLiWQWBmAJ0SxPyb434Kxj65wrxUcaZml59EaS167CikoPi51qIu_PdroIDfiRpcD0MqnR-6_1Zmu5p9lyhiGAhlE5KYtIm_g/s1600/button_home.png"
width="102"
/></a>
</div>
<br />
<div class="separator" style="clear: both; text-align: center;"><br /></div>
<br />
<div><br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-82650298913694161862022-01-23T11:58:00.006+05:302023-11-02T12:08:22.749+05:30Check whether a character is an alphabet, digit or special character<div style="text-align: justify;"><span style="font-family: "Open Sans";"><span style="font-size: medium;"><b>This program is based on C Programming Decision making concept (use of if..else statement).</b></span></span></div><div><span style="font-family: "Open Sans";"><span style="color: #660000;"><b><br /></b></span></span></div><div><span style="font-family: "Open Sans";"><span style="color: #660000;"><b>Problem definition: </b></span></span><b style="color: #660000; font-family: "Open Sans";">Write a C program to check whether a given character is an alphabet, digit or
special character.</b></div><div><div><br /></div>
</div>
<div style="background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #557799;">#include <stdio.h></span>
<span style="color: #333399; font-weight: bold;">int</span> <span style="color: #0066bb; font-weight: bold;">main</span>()
{
<span style="color: #333399; font-weight: bold;">char</span> chr;
printf(<span style="background-color: #fff0f0;">"Enter a character: "</span>);
scanf(<span style="background-color: #fff0f0;">"%c"</span>, <span style="color: #333333;">&</span>chr);
<span style="color: #888888;">/* logic to check whether it is an alphabet */</span>
<span style="color: #008800; font-weight: bold;">if</span>((chr <span style="color: #333333;">>=</span> <span style="color: #0044dd;">'a'</span> <span style="color: #333333;">&&</span> chr<span style="color: #333333;"><=</span><span style="color: #0044dd;">'z'</span>) <span style="color: #333333;">||</span> (chr<span style="color: #333333;">>=</span><span style="color: #0044dd;">'A'</span> <span style="color: #333333;">&&</span> chr<span style="color: #333333;"><=</span><span style="color: #0044dd;">'Z'</span>))
{
printf(<span style="background-color: #fff0f0;">"It is an alphabet.</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>);
}
<span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span>(chr<span style="color: #333333;">>=</span><span style="color: #0044dd;">'0'</span> <span style="color: #333333;">&&</span> chr<span style="color: #333333;"><=</span><span style="color: #0044dd;">'9'</span>) <span style="color: #888888;">/* to check digit */</span>
{
printf(<span style="background-color: #fff0f0;">"It is a digit.</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>);
}
<span style="color: #008800; font-weight: bold;">else</span> <span style="color: #888888;">/* else special character */</span>
{
printf(<span style="background-color: #fff0f0;">"It is a special character.</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>);
}
}
<span style="color: #38761d;"><b>Sample output 1</b></span>
<span style="color: #888888;">Enter a character: A</span>
<span style="color: #888888;">It is an alphabet.</span>
<span style="color: #38761d;"><b>Sample output 2</b></span>
<span style="color: #888888;">Enter a character: 5</span>
<span style="color: #888888;">It is a digit.</span>
<span style="color: #38761d;"><b><span>Sample output 3</span>
</b></span><span style="color: #888888;">Enter a character: @</span>
<span style="color: #888888;">It is a special character.</span>
</pre></div>
<div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://cprogrampracticals.blogspot.com/p/branchingstatements-in-c-c-language.html" style="margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" data-original-height="40" data-original-width="369" height="35" src="https://blogger.googleusercontent.com/img/a/AVvXsEh6WvB8wtMhBmBxSAwRhKsB7d7y5H1i_b-rPezKUqdyYpo5e-__N7O1xDavv0IWpJlqIcqg2TSnPiWJNZ_-3GfjHOQgi1rwKS5lHxnzZ6qyTIU3c_oWdKJ3Ja4xx9t-Lp6dJlPo6H9q3e7dyYkyjHjqRgV5KPdMi66_AMfi7oeOnjLNor0WKqMXfnt0qg=s320" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://cprogrampracticals.blogspot.com/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="34" data-original-width="102" height="34" src="https://blogger.googleusercontent.com/img/a/AVvXsEjhRV7KGxRARMCSPygHfjlCmYLGCjgieF8btm6IzNHvwYizzG_-JvKs0T8y45HQ_DVD0P8lED8tfcsPSOCXEgDCOPae-j3ZK038msNi8GFOUxbH1dVJuI7z1OrlnZyuBd_lAqrGtzMmRI1xdJvcMGy0SYF6mqRO5mjoeg34GP4AuNdMen_QPLIWMcQk_A" width="102" /></a></div><br />
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-40574107224756165472021-12-31T23:47:00.002+05:302023-11-02T12:10:50.766+05:30Use of #define in C program<h2 style="text-align: left;"><span style="color: #660000; font-family: Open Sans;">Use of #define </span></h2><div><div><span style="font-family: Open Sans;">In the C Programming Language, the #define directive allows the definition of macros within your source code.</span></div><div><span style="font-family: Open Sans;"><br /></span></div><div><span style="font-family: Open Sans;">Macros are a portion of the code which is given some name. Whenever this name is encountered by the compiler the compiler replaces the name with the actual piece of code.</span></div><div><span style="font-family: Open Sans;"><br /></span></div><div><span style="font-family: Open Sans;">In the following example, we have used</span></div><div><span style="font-family: Open Sans;"><br /></span></div><div><span style="font-family: Consolas;"><b>#define DISPLAY printf</b></span></div><div><span style="font-family: Open Sans;"><br /></span></div><div><span style="font-family: Open Sans;">During execution all the DISPLAY word will be replaced with printf first.</span></div></div><div><span style="font-family: Open Sans;"><br /></span></div><h3 style="text-align: left;"><span style="color: #38761d; font-family: Open Sans;">Example of #define in C program</span></h3><div><span style="color: #38761d; font-family: Open Sans;"><br /></span></div>
<div style="background: rgb(240, 240, 240); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #007020;">#include<stdio.h></span>
<span style="color: #007020;">#include<Windows.h></span>
<span style="color: #007020;">#define DISPLAY printf</span>
<span style="color: #902000;">int</span> <span style="color: #06287e;">main</span>()
{
<span style="color: #902000;">int</span> i;
<span style="color: #007020; font-weight: bold;">for</span>(i<span style="color: #666666;">=</span><span style="color: #40a070;">0</span>; i<span style="color: #666666;"><</span><span style="color: #40a070;">3</span>; i<span style="color: #666666;">++</span>)
{
DISPLAY(<span style="color: #4070a0;">"..... Good Bye 2021 ....."</span>);
Sleep(<span style="color: #40a070;">500</span>);
system(<span style="color: #4070a0;">"cls"</span>);
Sleep(<span style="color: #40a070;">500</span>);
}
<span style="color: #007020; font-weight: bold;">for</span>(i<span style="color: #666666;">=</span><span style="color: #40a070;">0</span>; i<span style="color: #666666;"><</span><span style="color: #40a070;">3</span>; i<span style="color: #666666;">++</span>)
{
DISPLAY(<span style="color: #4070a0;">"..... WEL COME 2022 ....."</span>);
Sleep(<span style="color: #40a070;">500</span>);
system(<span style="color: #4070a0;">"cls"</span>);
Sleep(<span style="color: #40a070;">500</span>);
}
<span style="color: #007020; font-weight: bold;">return</span> <span style="color: #40a070;">0</span>;
}
</pre></div>
<div><br /></div><div><span style="font-family: Open Sans;"><b>Output of the program</b></span></div><div><span style="font-family: Open Sans;"><br /></span></div><div><span style="font-family: Open Sans;">This will blinks three times</span></div><div><span style="font-family: Open Sans;"><br /></span></div><div><span style="font-family: Consolas;"><b> ..... Good Bye 2021 ..... </b></span></div><div><span style="font-family: Open Sans;"><br /></span></div><div><span style="font-family: Open Sans;">and then blinks </span><span style="font-family: "Open Sans";">three times </span></div><div><span style="font-family: "Open Sans";"><br /></span></div><div><span style="font-family: Consolas;"><b>..... WEL COME 2022 ..... </b></span></div>
</b></span><b><div><b><br /></b></div><div style="text-align: center;"><br /></div><div style="text-align: center;"><b><a href="https://cprogrampracticals.blogspot.com/"><span style="font-family: Open Sans;">Back to Home</span></a></b></div><div style="text-align: center;"><br /></div></b>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-15045979958178066482021-10-02T12:03:00.003+05:302021-10-02T12:07:00.569+05:30Flowchart to check Positive Negative or Zero number<p>
<span style="font-family: Open Sans;">This article is specifically posted for one of the request received from
the student.</span>
</p>
<h2 style="text-align: left;">
<span style="color: #660000; font-family: Open Sans;">Flowchart to check Positive Negative or Zero number</span>
</h2>
<p></p>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;">
<tbody>
<tr>
<td style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhyKmgXgQcc1uPxvcPx00Yj5u-iTiGYtRqjxT0Xb_NudPN6SXzGv2GqjgUhs8GJumP2xViqx-wObggOQMdsM_Ki375aKnJW0DSa8SsmlTzykcH9zUPrWgjqx6vBeQzxeGVgVqC6g5h5xcP/s778/Positive-Negative-Zero-number-flowchart.png" style="margin-left: auto; margin-right: auto;"><img alt="Flowchart to check Positive Negative or Zero Number" border="0" data-original-height="505" data-original-width="778" height="416" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhyKmgXgQcc1uPxvcPx00Yj5u-iTiGYtRqjxT0Xb_NudPN6SXzGv2GqjgUhs8GJumP2xViqx-wObggOQMdsM_Ki375aKnJW0DSa8SsmlTzykcH9zUPrWgjqx6vBeQzxeGVgVqC6g5h5xcP/w640-h416/Positive-Negative-Zero-number-flowchart.png" title="Flowchart to check Positive Negative or Zero Number" width="640" /></a>
</td>
</tr>
<tr>
<td class="tr-caption" style="text-align: center;">
<span style="font-family: Open Sans; font-size: x-small;"><b>Flowchart to Check Positive, Negative or Zero Number</b></span>
</td>
</tr>
</tbody>
</table>
<br />
<p></p>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-8386579191016137" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="7392899706" style="display: block; text-align: center;"></ins><script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="separator" style="clear: both; text-align: center;"><br /></div>
<p><span style="font-family: "Open Sans";">Recommended readings:</span></p>
<h3 style="background-color: white; color: #333333; margin: 0px; position: relative;">
<ul style="line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="border: none; margin: 0px 0px 0.25em; padding: 0px;">
<span style="font-size: medium;"><span style="color: blue;"><a href="http://cprogrampracticals.blogspot.in/2016/06/flowchart-to-check-positive-number.html" style="color: #6699cc; font-weight: normal; text-decoration-line: none;" target="_blank"><span style="font-family: Open Sans;">Flowchart to check positive number.</span></a></span>
</span></li>
</ul>
<ul style="line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="border: none; margin: 0px 0px 0.25em; padding: 0px;">
<span style="font-size: medium;"><span style="color: blue;"><a href="http://cprogrampracticals.blogspot.in/2016/06/flowchart-to-check-negative-number.html" style="color: #6699cc; font-weight: normal; text-decoration-line: none;" target="_blank"><span style="font-family: Open Sans;">Flowchart to check negative number.</span></a></span>
</span></li>
</ul>
<ul style="line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="border: none; margin: 0px 0px 0.25em; padding: 0px;">
<span style="font-size: medium;"><span style="color: blue;"><a href="http://cprogrampracticals.blogspot.in/2016/06/flowchart-to-check-odd-or-even-number.html" style="color: #6699cc; font-weight: normal; text-decoration-line: none;" target="_blank"><span style="font-family: Open Sans;">Flowchart to check Odd or Even number.</span></a></span>
</span></li>
</ul>
<ul style="line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="border: none; margin: 0px 0px 0.25em; padding: 0px;">
<span style="font-size: medium;"><span style="color: blue;"><a href="http://cprogrampracticals.blogspot.in/2016/06/draw-flowchart-to-display-good-morning.html" style="color: #6699cc; font-weight: normal; text-decoration-line: none;" target="_blank"><span style="font-family: Open Sans;">Flowchart to display Good morning message based on given
time.</span></a></span>
</span></li>
</ul>
<ul style="line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="border: none; margin: 0px 0px 0.25em; padding: 0px;">
<span style="font-size: medium;"><a href="http://cprogrampracticals.blogspot.in/2016/09/flowchart-to-print-to-z.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue; font-weight: normal;"><span style="font-family: Open Sans;">Flowchart to print A to Z.</span></span></a>
</span></li>
</ul>
<ul style="line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="border: none; margin: 0px 0px 0.25em; padding: 0px;">
<span style="font-size: medium;"><span style="color: blue; font-weight: normal;"><a href="http://cprogrampracticals.blogspot.in/2016/09/flowchart-to-print-10-9-8-1-using.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="font-family: Open Sans;">Flowchart to print 10, 9, ......, 1.</span></a></span>
</span></li>
<li style="border: none; margin: 0px 0px 0.25em; padding: 0px;">
<span style="font-size: medium;"><a href="http://cprogrampracticals.blogspot.in/2017/04/flowchart-to-add-two-numbers.html" style="color: #6699cc; font-weight: normal; text-decoration-line: none;" target="_blank"><span style="font-family: Open Sans;">Flowchart to Add two numbers.</span></a>
</span></li>
<li style="border: none; margin: 0px 0px 0.25em; padding: 0px;">
<span style="font-size: medium;"><a href="http://cprogrampracticals.blogspot.in/2017/04/flowchart-to-subtract-two-numbers.html" style="color: #6699cc; font-weight: normal; text-decoration-line: none;" target="_blank"><span style="font-family: Open Sans;">Flowchart to subtract two numbers.</span></a>
</span></li>
<li style="border: none; margin: 0px 0px 0.25em; padding: 0px;">
<span style="font-size: medium;"><a href="http://cprogrampracticals.blogspot.in/2017/04/flowchart-to-print-area-of-square.html" style="color: #6699cc; font-weight: normal; text-decoration-line: none;" target="_blank"><span style="font-family: Open Sans;">Flowchart to print area of square.</span></a>
</span></li>
<li style="border: none; margin: 0px 0px 0.25em; padding: 0px;">
<span style="color: #6699cc; font-weight: normal;"><a href="http://cprogrampracticals.blogspot.in/2017/04/flowchart-to-print-area-of-rectangle.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="font-family: Open Sans; font-size: medium;">Flowchart to print area of rectangle.</span></a></span>
</li>
</ul>
<div><br /> </div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Open Sans; font-size: medium;"><a href="https://cprogrampracticals.blogspot.com/p/flowchart.html" target="_blank">< Flowcharts ></a></span>
</div>
<div class="separator" style="clear: both; text-align: center;"><br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://cprogrampracticals.blogspot.com/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="34" data-original-width="102" height="34" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHSZrObaKAa8S17Rosg1FAtKCMYTTRnj_NGKBseeaLDHDHZZOtlperCy8AL6kM5xr6XN72jVUbbcSNYUe8MIc9wd4328rpkIXk9BFPpj7-LpdQzDr8xyve1xk6JiLdIHREl3lFhnlwkUNq/s0/button_home.png" width="102" /></a>
</div>
<br />
<div><br /></div>
</h3>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-7845752119405847982021-08-01T20:09:00.005+05:302021-08-01T21:10:08.511+05:30C Program to perform Matrix Subtraction<h2 style="text-align: left;"><span style="color: #990000; font-family: Roboto; font-size: large;">Matrix Subtraction</span></h2><span style="font-family: Roboto;">We will write a C program to perform matrix subtraction operation.</span><div><span style="font-family: Roboto;"><br /></span></div><div><h3 style="text-align: left;"><span style="font-family: Roboto;">Key points for subtraction of matrices</span></h3><div><ul style="text-align: left;"><li><span style="font-family: Roboto;">Two matrices should be of same order (number of rows=number of columns).</span></li><li><span style="font-family: Roboto;">Subtract the corresponding element of matrices.</span></li></ul></div><h3 style="text-align: left;"><span style="font-family: Roboto;">Example: Subtraction of matrix of order 3 * 3</span></h3></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipYMbEBGEadDnxKA5qPaQCNMF9YznkVPqQXt1xYTaVlF2Kd46DpBx-YIeL7PwF5Be0YXijmD_0_GTdirobYNHmnlAgIFBh8dPSNSZvdu5oK82gSMvomOrdpbjEZ1WhKh7KodhIX6sr5XOS/s158/Matrix+A.png" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="81" data-original-width="158" height="81" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipYMbEBGEadDnxKA5qPaQCNMF9YznkVPqQXt1xYTaVlF2Kd46DpBx-YIeL7PwF5Be0YXijmD_0_GTdirobYNHmnlAgIFBh8dPSNSZvdu5oK82gSMvomOrdpbjEZ1WhKh7KodhIX6sr5XOS/s0/Matrix+A.png" width="158" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4h1zt5u8TA-wh2WQAV0db2Ng2nOtUOmcUBwUu5iByYdoLuRThd2RF6NRfMPz7G1dQIHShv35temnyWskoha0GiU3j1TgRCUaYLpHEcE3oAJLgQijZtigN-yl0KIkTs83OHwFcg4I86jVA/s127/Matrix+B.png" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="81" data-original-width="127" height="81" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4h1zt5u8TA-wh2WQAV0db2Ng2nOtUOmcUBwUu5iByYdoLuRThd2RF6NRfMPz7G1dQIHShv35temnyWskoha0GiU3j1TgRCUaYLpHEcE3oAJLgQijZtigN-yl0KIkTs83OHwFcg4I86jVA/s0/Matrix+B.png" width="127" /></a></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Roboto; font-size: medium;"><b>Subtraction of Matrix (A-B) is as under:</b></span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Roboto; font-size: medium;"><b><br /></b></span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Roboto; font-size: medium;"><b>A - B = C</b></span></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMN-KLuE59fshl3fSA4EIeNCLVUSYGDStuMsdN8KbSezR1ygoqo_4zG7klPG4LiFKGIi83bgiEuae9lDwYw3rPkrxNQ6ctTgIRbnnKILUx5l4dYYQpnHQMSWuS9-IcOkRlkq2qgO4Lc9VP/s301/MatrixA-B.png" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="81" data-original-width="301" height="81" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMN-KLuE59fshl3fSA4EIeNCLVUSYGDStuMsdN8KbSezR1ygoqo_4zG7klPG4LiFKGIi83bgiEuae9lDwYw3rPkrxNQ6ctTgIRbnnKILUx5l4dYYQpnHQMSWuS9-IcOkRlkq2qgO4Lc9VP/s0/MatrixA-B.png" width="301" /></a></div><br /><h3 style="clear: both; text-align: left;"><b><span style="color: #990000; font-family: Roboto; font-size: medium;">C Program to perform Matrix Subtraction</span></b></h3><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Consolas;"><b>Program Code:</b></span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Consolas;"><b><br /></b></span></div>
<!--HTML generated using hilite.me--><div style="background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #557799;">#include<stdio.h></span>
<span style="color: #333399; font-weight: bold;">int</span> <span style="color: #0066bb; font-weight: bold;">main</span>()
{
<span style="color: #333399; font-weight: bold;">int</span> A[<span style="color: #0000dd; font-weight: bold;">3</span>][<span style="color: #0000dd; font-weight: bold;">3</span>],B[<span style="color: #0000dd; font-weight: bold;">3</span>][<span style="color: #0000dd; font-weight: bold;">3</span>],C[<span style="color: #0000dd; font-weight: bold;">3</span>][<span style="color: #0000dd; font-weight: bold;">3</span>],i, j;
<span style="color: #888888;">//Loops for Reading A matrix</span>
<span style="color: #008800; font-weight: bold;">for</span> ( i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> <span style="color: #0000dd; font-weight: bold;">3</span>; i<span style="color: #333333;">++</span> ) <span style="color: #888888;">//related to row</span>
{
<span style="color: #008800; font-weight: bold;">for</span> ( j <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; j <span style="color: #333333;"><</span> <span style="color: #0000dd; font-weight: bold;">3</span>; j<span style="color: #333333;">++</span> ) <span style="color: #888888;">//related to column</span>
{
printf(<span style="background-color: #fff0f0;">"Matrix A[%d][%d]:"</span>,i,j);
scanf(<span style="background-color: #fff0f0;">"%d"</span>, <span style="color: #333333;">&</span>A[i][j]) ;
}
}
<span style="color: #888888;">//Loops for Reading B matrix</span>
<span style="color: #008800; font-weight: bold;">for</span> ( i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> <span style="color: #0000dd; font-weight: bold;">3</span>; i<span style="color: #333333;">++</span> ) <span style="color: #888888;">//related to row</span>
{
<span style="color: #008800; font-weight: bold;">for</span> ( j <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; j <span style="color: #333333;"><</span> <span style="color: #0000dd; font-weight: bold;">3</span>; j<span style="color: #333333;">++</span> ) <span style="color: #888888;">//related to column</span>
{
printf(<span style="background-color: #fff0f0;">"Matrix B[%d][%d]:"</span>,i,j);
scanf(<span style="background-color: #fff0f0;">"%d"</span>, <span style="color: #333333;">&</span>B[i][j]) ;
}
}
printf(<span style="background-color: #fff0f0;">"Matrix A is as under: </span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>) ;
<span style="color: #888888;">/* Print Matrix A, B */</span>
<span style="color: #008800; font-weight: bold;">for</span> ( i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> <span style="color: #0000dd; font-weight: bold;">3</span>; i<span style="color: #333333;">++</span> ) <span style="color: #888888;">//related to row</span>
{
<span style="color: #008800; font-weight: bold;">for</span> ( j <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; j <span style="color: #333333;"><</span> <span style="color: #0000dd; font-weight: bold;">3</span>; j<span style="color: #333333;">++</span> ) <span style="color: #888888;">//related to column</span>
{
printf(<span style="background-color: #fff0f0;">" %d</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\t</span><span style="background-color: #fff0f0;"> "</span>,A[i][j] );
}
printf(<span style="background-color: #fff0f0;">"</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>);
}
printf(<span style="background-color: #fff0f0;">"Matrix B is as under: </span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>) ;
<span style="color: #008800; font-weight: bold;">for</span> ( i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> <span style="color: #0000dd; font-weight: bold;">3</span>; i<span style="color: #333333;">++</span> ) <span style="color: #888888;">//related to row</span>
{
<span style="color: #008800; font-weight: bold;">for</span> ( j <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; j <span style="color: #333333;"><</span> <span style="color: #0000dd; font-weight: bold;">3</span>; j<span style="color: #333333;">++</span> ) <span style="color: #888888;">//related to column</span>
{
printf(<span style="background-color: #fff0f0;">" %d</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\t</span><span style="background-color: #fff0f0;"> "</span>,B[i][j] );
}
printf(<span style="background-color: #fff0f0;">"</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>);
}
printf(<span style="background-color: #fff0f0;">"Matrix Subtraction is as under: </span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>);
<span style="color: #008800; font-weight: bold;">for</span> ( i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> <span style="color: #0000dd; font-weight: bold;">3</span>; i<span style="color: #333333;">++</span> ) <span style="color: #888888;">//related to row</span>
{
<span style="color: #008800; font-weight: bold;">for</span> ( j <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; j <span style="color: #333333;"><</span> <span style="color: #0000dd; font-weight: bold;">3</span>; j<span style="color: #333333;">++</span> ) <span style="color: #888888;">//related to column</span>
{
printf(<span style="background-color: #fff0f0;">" %d</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\t</span><span style="background-color: #fff0f0;"> "</span>,A[i][j] <span style="color: #333333;">-</span> B[i][j] );
}
printf(<span style="background-color: #fff0f0;">"</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\n</span><span style="background-color: #fff0f0;">"</span>);
}
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
</pre></div>
<div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><div class="separator" style="clear: both;"><span style="font-family: Consolas;"><b>Program Output:</b></span></div></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Consolas;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;"><div class="separator" style="clear: both;"><div class="separator" style="clear: both;">
<div style="background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;">Matrix A[<span style="color: #0000dd; font-weight: bold;">0</span>][<span style="color: #0000dd; font-weight: bold;">0</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">4</span>
Matrix A[<span style="color: #0000dd; font-weight: bold;">0</span>][<span style="color: #0000dd; font-weight: bold;">1</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">5</span>
Matrix A[<span style="color: #0000dd; font-weight: bold;">0</span>][<span style="color: #0000dd; font-weight: bold;">2</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">6</span>
Matrix A[<span style="color: #0000dd; font-weight: bold;">1</span>][<span style="color: #0000dd; font-weight: bold;">0</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">7</span>
Matrix A[<span style="color: #0000dd; font-weight: bold;">1</span>][<span style="color: #0000dd; font-weight: bold;">1</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">8</span>
Matrix A[<span style="color: #0000dd; font-weight: bold;">1</span>][<span style="color: #0000dd; font-weight: bold;">2</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">9</span>
Matrix A[<span style="color: #0000dd; font-weight: bold;">2</span>][<span style="color: #0000dd; font-weight: bold;">0</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">10</span>
Matrix A[<span style="color: #0000dd; font-weight: bold;">2</span>][<span style="color: #0000dd; font-weight: bold;">1</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">11</span>
Matrix A[<span style="color: #0000dd; font-weight: bold;">2</span>][<span style="color: #0000dd; font-weight: bold;">2</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">12</span>
Matrix B[<span style="color: #0000dd; font-weight: bold;">0</span>][<span style="color: #0000dd; font-weight: bold;">0</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">1</span>
Matrix B[<span style="color: #0000dd; font-weight: bold;">0</span>][<span style="color: #0000dd; font-weight: bold;">1</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">3</span>
Matrix B[<span style="color: #0000dd; font-weight: bold;">0</span>][<span style="color: #0000dd; font-weight: bold;">2</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">2</span>
Matrix B[<span style="color: #0000dd; font-weight: bold;">1</span>][<span style="color: #0000dd; font-weight: bold;">0</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">5</span>
Matrix B[<span style="color: #0000dd; font-weight: bold;">1</span>][<span style="color: #0000dd; font-weight: bold;">1</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">4</span>
Matrix B[<span style="color: #0000dd; font-weight: bold;">1</span>][<span style="color: #0000dd; font-weight: bold;">2</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">3</span>
Matrix B[<span style="color: #0000dd; font-weight: bold;">2</span>][<span style="color: #0000dd; font-weight: bold;">0</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">2</span>
Matrix B[<span style="color: #0000dd; font-weight: bold;">2</span>][<span style="color: #0000dd; font-weight: bold;">1</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">3</span>
Matrix B[<span style="color: #0000dd; font-weight: bold;">2</span>][<span style="color: #0000dd; font-weight: bold;">2</span>]<span style="color: #333333;">:</span><span style="color: #0000dd; font-weight: bold;">6</span>
Matrix A is as under<span style="color: #333333;">:</span>
<span style="color: #0000dd; font-weight: bold;">4</span> <span style="color: #0000dd; font-weight: bold;">5</span> <span style="color: #0000dd; font-weight: bold;">6</span>
<span style="color: #0000dd; font-weight: bold;">7</span> <span style="color: #0000dd; font-weight: bold;">8</span> <span style="color: #0000dd; font-weight: bold;">9</span>
<span style="color: #0000dd; font-weight: bold;">10</span> <span style="color: #0000dd; font-weight: bold;">11</span> <span style="color: #0000dd; font-weight: bold;">12</span>
Matrix B is as under<span style="color: #333333;">:</span>
<span style="color: #0000dd; font-weight: bold;">1</span> <span style="color: #0000dd; font-weight: bold;">3</span> <span style="color: #0000dd; font-weight: bold;">2</span>
<span style="color: #0000dd; font-weight: bold;">5</span> <span style="color: #0000dd; font-weight: bold;">4</span> <span style="color: #0000dd; font-weight: bold;">3</span>
<span style="color: #0000dd; font-weight: bold;">2</span> <span style="color: #0000dd; font-weight: bold;">3</span> <span style="color: #0000dd; font-weight: bold;">6</span>
Matrix Subtraction is as under<span style="color: #333333;">:</span>
<span style="color: #0000dd; font-weight: bold;">3</span> <span style="color: #0000dd; font-weight: bold;">2</span> <span style="color: #0000dd; font-weight: bold;">4</span>
<span style="color: #0000dd; font-weight: bold;">2</span> <span style="color: #0000dd; font-weight: bold;">4</span> <span style="color: #0000dd; font-weight: bold;">6</span>
<span style="color: #0000dd; font-weight: bold;">8</span> <span style="color: #0000dd; font-weight: bold;">8</span> <span style="color: #0000dd; font-weight: bold;">6</span>
</pre></div>
</div><div class="separator" style="clear: both;"><br /></div></div></div><div class="separator" style="clear: both; text-align: center;">* * * * *</div>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-8386579191016137" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="7392899706" style="display: block; text-align: center;"></ins><script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;">* * * * *</div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Open Sans;"><b>< <a href="https://cprogrampracticals.blogspot.com/p/c-arrays.html">Back to Arrays</a> ></b></span></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://cprogrampracticals.blogspot.com/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="34" data-original-width="102" height="34" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9nPINjIKFDKHVmNEpSd76A8ZnC_iNAAHOW1rohA4VJhlO0_jgPXxhR9Lk7G3HeanXNBphDypviRPp2qxk-AwNWj9_k0RGH3rCQ8hjYVuvBJt894891t72vuqN625KTt-vCAvWyT1PNngG/s0/button_home.png" width="102" /></a></div><br /><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><br /><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-78673519335236929162021-05-08T18:11:00.002+05:302021-05-08T18:16:23.371+05:30 Flowchart to input 5 numbers from user and to print odd or even number.<h2 style="text-align: left;"><span style="color: #660000; font-family: Open Sans;"><b>Flowchart to read 5 numbers from user and to print odd or even number.</b></span></h2><p><b><span style="font-family: Open Sans;">[ This article is posted for a request received from the visitor of the blog.]</span></b></p><p><span style="font-family: Open Sans;">Following flowchart will input 5 numbers one by one from the user and prints whether it is Odd or Even number.</span></p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeR6uFNVFjLNHXR5AAq3r9igXO6irqIRsT1Gtti73kK4ByiZKka6Yz7_QVsUdRe_BBPw3Se8r7-mNTCwlHOXPc_v-vRt99EZB8jkCUBhb0-NZBfqnHNkCxDU9ri56Fal5AZ77Pbn0-6CEr/s972/flowchart-to-input-5-numbers-and-print-odd-even.png" style="margin-left: auto; margin-right: auto;"><img alt="Flowchart to input 5 numbers from user and to print odd or even number." border="0" data-original-height="972" data-original-width="725" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeR6uFNVFjLNHXR5AAq3r9igXO6irqIRsT1Gtti73kK4ByiZKka6Yz7_QVsUdRe_BBPw3Se8r7-mNTCwlHOXPc_v-vRt99EZB8jkCUBhb0-NZBfqnHNkCxDU9ri56Fal5AZ77Pbn0-6CEr/w477-h640/flowchart-to-input-5-numbers-and-print-odd-even.png" title="Flowchart to input 5 numbers from user and to print odd or even number." width="477" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b><span style="font-family: Consolas;">Fig. Flowchart to input 5 numbers and to print Odd or Even</span></b></td></tr></tbody></table><p style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="color: #660000; font-family: "Open Sans";"><b><span style="font-size: medium;">Output of the flowchart:</span></b></span></p><div><div><span style="color: #38761d; font-family: Consolas; font-size: medium;">1 is odd number</span></div><div><span style="color: #38761d; font-family: Consolas; font-size: medium;">2 is even number</span></div><div><span style="color: #38761d; font-family: Consolas; font-size: medium;">3 is odd number</span></div><div><span style="color: #38761d; font-family: Consolas; font-size: medium;">4 is even number</span></div><div><span style="color: #38761d; font-family: Consolas; font-size: medium;">5 is odd number</span></div><div><span style="color: #38761d; font-family: Consolas; font-size: medium;">----Run complete. 35 symbols evaluated.----</span></div></div><div><span style="color: #38761d; font-family: Consolas;"><br /></span></div><br /><p><br /></p><p><br /></p><p><br /></p>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-8386579191016137" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="7392899706" style="display: block; text-align: center;"></ins><script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><div><p style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px;"><b style="font-family: "Open Sans";">This flowchart is generated using Raptor tool. Read more about <a href="https://cprogrampracticals.blogspot.com/p/raptor.html" style="color: #336699; text-decoration-line: none;" target="_blank">RAPTOR here</a>. </b></p><h3 style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; margin: 0px; position: relative;"><span style="font-family: Overpass; font-size: small;"><br /></span></h3><h3 style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; margin: 0px; position: relative;"><span style="color: #660000; font-family: Overpass; font-size: large;">Top 10 Flowcharts Examples</span></h3><p style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px;"><span style="font-family: Overpass;">You may like to visit following top 10 flowchart examples.<br /></span></p><ul style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px; line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;"><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/06/flowchart-to-check-positive-number.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to check positive number.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/06/flowchart-to-check-negative-number.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to check negative number.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/06/flowchart-to-check-odd-or-even-number.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to check Odd or Even number.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/06/draw-flowchart-to-display-good-morning.html" style="color: #33aaff; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to display Good morning message based on given time.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/09/flowchart-to-print-to-z.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to print A to Z.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/09/flowchart-to-print-10-9-8-1-using.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to print 10, 9, ......, 1.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2017/04/flowchart-to-add-two-numbers.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to Add two numbers.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2017/04/flowchart-to-subtract-two-numbers.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to subtract two numbers.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2017/04/flowchart-to-print-area-of-square.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to print area of square.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><span style="color: blue;"><span style="font-family: Overpass;"><a href="http://cprogrampracticals.blogspot.com/2017/04/flowchart-to-print-area-of-rectangle.html" style="color: #6699cc; text-decoration-line: none;" target="_blank">Flowchart to print area of rectangle.</a></span></span></li></ul><br style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px;" /><div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px; text-align: center;"><b><span style="color: #660000; font-family: Overpass; font-size: medium;">< <a href="https://cprogrampracticals.blogspot.com/p/flowchart.html" style="color: #336699; text-decoration-line: none;">Flowchart Page</a> ></span></b></div><div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px; text-align: center;"><b><span style="color: #660000; font-family: Overpass; font-size: medium;"><br /></span></b></div><div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px; text-align: center;"><b><span style="color: #660000; font-family: Overpass; font-size: medium;">< <a href="https://cprogrampracticals.blogspot.com/" style="color: #336699; text-decoration-line: none;">Home Page</a> ></span></b></div></div><div><b><span style="color: #660000; font-family: Overpass; font-size: medium;"><br /></span></b></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-37745592247453989662021-02-15T19:31:00.006+05:302021-03-28T21:38:02.974+05:30C program to find square of given number without an argument and a return value<h2 style="text-align: left;"><span style="color: #274e13; font-family: Open Sans;"><b>C Programming => Functions</b></span></h2><h3 style="text-align: left;"><span style="font-family: Open Sans; font-weight: normal;">C program to find square of given number using function concept. This program demonstrate use of function without an argument and a return value.</span></h3><p><span style="color: #660000; font-family: Open Sans;"><b>Program code</b></span></p><p><span style="font-family: Consolas; font-size: medium;"><span style="color: #38761d;">#include<stdio.h><br /></span><span style="color: #2b00fe;">int </span>square(); //function prototype declaration.<br /><span style="color: #2b00fe;">int </span>number; //use of global variable<br /><br /><span style="color: #2b00fe;">int </span>main()<br />{<br /> <span style="color: #2b00fe;">int </span>answer;<br /> answer = square(); //Call function.<br /> printf(<span style="color: #990000;">"Square of %d is %d."</span>, number, answer);<br /> <span style="color: #ff00fe;">return </span>0;<br />}<br /><br /></span></p><p><span style="font-family: Consolas; font-size: medium;">//User defined function to find square()<br /><span style="color: #2b00fe;">int </span>square()<br />{<br /> printf(<span style="color: #990000;">"Enter your number:"</span>);<br /> scanf(<span style="color: #990000;">"%d"</span>, &number);<br /> //return answer to main function<br /> <span style="color: #ff00fe;">return</span>(number*number); <br />}<br /></span><br /><b style="color: #660000; font-family: "Open Sans";">Output of the program</b></p><span style="font-family: Consolas; font-size: medium;">Enter your number:5<br />Square of 5 is 25.</span><div><br /><script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-8386579191016137" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="7392899706" style="display: block; text-align: center;"></ins><script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div><span style="font-family: Open Sans;"><div style="text-align: center;"><br /></div><div style="font-weight: bold; text-align: center;"><a href="https://cprogrampracticals.blogspot.com/p/functions.html">< Back to Function Page ></a></div><div style="text-align: center;"><br /></div><div style="font-weight: bold; text-align: center;"><a href="https://cprogrampracticals.blogspot.com/">< Back to Home ></a></div><div style="font-weight: bold; text-align: center;"><br /></div><div style="font-weight: bold; text-align: center;"><br /></div></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4925406909070857716.post-88770887201996269712021-01-18T10:44:00.012+05:302021-01-18T10:47:21.630+05:30Flowchart to check Odd or Even Number between 1 to 10<h3 style="text-align: left;"><span style="color: #660000; font-family: Open Sans;"><b>Flowchart to check odd or even number between 1 to 10 numbers</b></span></h3><p><span style="font-family: Open Sans;"></span></p><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Open Sans;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJBNob6bbr0i6RoHgsqZI37ryg8-5TyCyJiKY_SggK7so_-U38PvE-_PK3j8KoHVkdJxq212A6IuxVIfZl_Fv6yTC4UV51gbr5xx-ARmYzr3gOW_6tKoKiGhnb75L-2xVna9arK5CfYYf4/s707/flowchart-to-print-odd-even-between-1-to-10.png" style="margin-left: 1em; margin-right: 1em;"><img alt="Flowchart to check Odd or Even Number between 1 to 10" border="0" data-original-height="707" data-original-width="585" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJBNob6bbr0i6RoHgsqZI37ryg8-5TyCyJiKY_SggK7so_-U38PvE-_PK3j8KoHVkdJxq212A6IuxVIfZl_Fv6yTC4UV51gbr5xx-ARmYzr3gOW_6tKoKiGhnb75L-2xVna9arK5CfYYf4/s16000/flowchart-to-print-odd-even-between-1-to-10.png" title="Flowchart to check Odd or Even Number between 1 to 10" /></a></span></div><span style="font-family: Open Sans;"><br /><b><br /></b></span><p></p><p><br /></p><p><span style="color: #660000; font-family: Open Sans;"><b>Output of the flowchart:</b></span></p><p><span style="font-family: Consolas; font-size: medium;">1 is odd</span></p><p><span style="font-family: Consolas; font-size: medium;">2 is even</span></p><p><span style="font-family: Consolas; font-size: medium;">3 is odd</span></p><p><span style="font-family: Consolas; font-size: medium;">4 is even</span></p><p><span style="font-family: Consolas; font-size: medium;">5 is odd</span></p><p><span style="font-family: Consolas; font-size: medium;">6 is even</span></p><p><span style="font-family: Consolas; font-size: medium;">7 is odd</span></p><p><span style="font-family: Consolas; font-size: medium;">8 is even</span></p><p><span style="font-family: Consolas; font-size: medium;">9 is odd</span></p><p><span style="font-family: Consolas; font-size: medium;">10 is even</span></p><p><span style="font-family: Consolas; font-size: medium;">----Run complete. 55 symbols evaluated.----</span></p><p><span style="font-family: Consolas; font-size: medium;"><br /></span></p><p style="text-align: center;"><span style="font-family: Consolas; font-size: medium;"><b>* * * * *</b></span></p><p style="text-align: center;"><span style="font-family: Consolas; font-size: medium;"><br />
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-8386579191016137" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="7392899706" style="display: block; text-align: center;"></ins><script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</span></p><p><b style="font-family: "Open Sans";"><br /></b></p><p><b style="font-family: "Open Sans";">This flowchart is generated using Raptor tool. Read more about <a href="https://cprogrampracticals.blogspot.com/p/raptor.html" target="_blank">RAPTOR here</a>. </b></p><h3 style="background-color: white; color: #333333; margin: 0px; position: relative;"><span style="font-family: Overpass; font-size: small;"><br /></span></h3><h3 style="background-color: white; margin: 0px; position: relative;"><span style="color: #660000; font-family: Overpass; font-size: large;">Top 10 Flowcharts Examples</span></h3><p><span style="font-family: Overpass;"><span style="background-color: white; color: #333333;"></span><span style="background-color: white; color: #333333;">You may like to visit following top 10 flowchart examples.</span><br style="background-color: white; color: #333333;" /></span></p><ul style="background-color: white; color: #333333; line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;"><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/06/flowchart-to-check-positive-number.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to check positive number.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/06/flowchart-to-check-negative-number.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to check negative number.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/06/flowchart-to-check-odd-or-even-number.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to check Odd or Even number.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/06/draw-flowchart-to-display-good-morning.html" style="color: #33aaff; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to display Good morning message based on given time.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/09/flowchart-to-print-to-z.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to print A to Z.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2016/09/flowchart-to-print-10-9-8-1-using.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to print 10, 9, ......, 1.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2017/04/flowchart-to-add-two-numbers.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to Add two numbers.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2017/04/flowchart-to-subtract-two-numbers.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to subtract two numbers.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><a href="http://cprogrampracticals.blogspot.com/2017/04/flowchart-to-print-area-of-square.html" style="color: #6699cc; text-decoration-line: none;" target="_blank"><span style="color: blue;"><span style="font-family: Overpass;">Flowchart to print area of square.</span></span></a></li><li style="border: none; margin: 0px 0px 0.25em; padding: 0px;"><span style="color: blue; text-decoration-line: none;"><span style="font-family: Overpass;"><a href="http://cprogrampracticals.blogspot.com/2017/04/flowchart-to-print-area-of-rectangle.html" style="color: #6699cc; text-decoration-line: none;" target="_blank">Flowchart to print area of rectangle.</a></span></span></li></ul><br /><div style="text-align: center;"><b><span style="color: #660000; font-family: Overpass; font-size: medium;">< <a href="https://cprogrampracticals.blogspot.com/p/flowchart.html">Flowchart Page</a> ></span></b></div><div style="text-align: center;"><b><span style="color: #660000; font-family: Overpass; font-size: medium;"><br /></span></b></div><div style="text-align: center;"><b><span style="color: #660000; font-family: Overpass; font-size: medium;">< <a href="https://cprogrampracticals.blogspot.com/">Home Page</a> ></span></b></div><div style="text-align: center;"><b><span style="color: #660000; font-family: Overpass; font-size: medium;"><br /></span></b></div>Unknownnoreply@blogger.com0