<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>if else statement | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/if-else-statement/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Thu, 16 Feb 2023 11:24:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>If else statement in java</title>
		<link>https://studentprojects.in/uncategorized/if-else-statement-in-java/</link>
					<comments>https://studentprojects.in/uncategorized/if-else-statement-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Tue, 28 Feb 2023 07:45:50 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[if else statement]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=10212</guid>

					<description><![CDATA[<p>An if&#8230;..else statement is a type of control flow statement in which there are two blocks of code. The first block of code, located inside the if statement, will be executed if the condition specified in the statement evaluates to true. If the condition is false, the second block of code, located inside the else</p>
<p>The post <a href="https://studentprojects.in/uncategorized/if-else-statement-in-java/">If else statement in java</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>An if&#8230;..else statement is a type of control flow statement in which there are two blocks of code. The first block of code, located inside the if statement, will be executed if the condition specified in the statement evaluates to true. If the condition is false, the second block of code, located inside the else statement, will be executed instead.</p>



<p>The syntax for an if&#8230;..else statement can be written as follows:</p>



<pre class="wp-block-code"><code lang="java" class="language-java">if (condition) {
	//block of code
} else {
	//block of code
}</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" src="https://studentprojects.in/wp-content/uploads/2023/02/image-1.png" alt="" class="wp-image-10213" width="298" height="293" srcset="https://studentprojects.in/wp-content/uploads/2023/02/image-1.png 443w, https://studentprojects.in/wp-content/uploads/2023/02/image-1-300x295.png 300w, https://studentprojects.in/wp-content/uploads/2023/02/image-1-24x24.png 24w, https://studentprojects.in/wp-content/uploads/2023/02/image-1-48x48.png 48w" sizes="(max-width: 298px) 100vw, 298px" /></figure></div>


<p>Example:</p>



<pre class="wp-block-code"><code lang="java" class="language-java">public class JavaIf {
    public static void main(String[] args) {
        String name = "Mohan";
        int Roll = 25;
        if (name == "Mohan" &amp;&amp; Roll == 26) {
            System.out.println("Details of Mohan.");
        } else {
            System.out.println("Invalid details.");
        }
    }
}</code></pre>



<p>Output:</p>



<pre class="wp-block-code"><code lang="java" class="language-java">Invalid details.</code></pre><p>The post <a href="https://studentprojects.in/uncategorized/if-else-statement-in-java/">If else statement in java</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/uncategorized/if-else-statement-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>C if&#8230;else statements</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/c-if-else-statements/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/c-if-else-statements/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Tue, 25 Oct 2022 08:00:55 +0000</pubDate>
				<category><![CDATA[C Tutorials]]></category>
		<category><![CDATA[if else statement]]></category>
		<category><![CDATA[syntax of if else statement]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=9669</guid>

					<description><![CDATA[<p>Sometimes, we want to carry out one set of instructions only when a certain condition is satisfied, and another set only when that condition is not. A decision control system is used in C to handle situations of this nature. The decision control instruction is implemented in C using the if keyword, just like in</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/c-if-else-statements/">C if…else statements</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Sometimes, we want to carry out one set of instructions only when a certain condition is satisfied, and another set only when that condition is not. A decision control system is used in C to handle situations of this nature.</p>



<p>The decision control instruction is implemented in C using the if keyword, just like in any other programming language. The if statement&#8217;s condition is always encased in a pair of parentheses. The set of statements that follow the if statement will be executed if the condition is met. Additionally, the statement will not be executed if the condition evaluates to false; instead, the programme will skip the enclosing portion of code.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" loading="lazy" src="https://studentprojects.in/wp-content/uploads/2022/10/image-8.png" alt="" class="wp-image-9670" width="448" height="210" srcset="https://studentprojects.in/wp-content/uploads/2022/10/image-8.png 660w, https://studentprojects.in/wp-content/uploads/2022/10/image-8-300x141.png 300w" sizes="(max-width: 448px) 100vw, 448px" /></figure>



<p>If the expression after the if evaluates to true, the statement contained in the if block will be carried out. However, if the if block is followed by an else block, a sequence of statements in the else block will be executed when the if block&#8217;s condition is false.</p>



<p>The syntax for if-else statements is as follows:</p>



<pre class="wp-block-code"><code class="">if ( condition ){
statements;}
 else {
statements;}</code></pre>



<p>One scenario where the if-else phrase could be utilised is</p>



<pre class="wp-block-code"><code class="">#include &lt;stdio.h&gt;
int main()
{
    int num = 10;
    if (num &lt;= 10)
    {
        printf("Number is less than equal to 10.");
    }
    else
    {
        printf("Number is greater than 10.");
    }
    return 0;
}</code></pre>



<p>Output: Number is less than equal to 10.</p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/c-if-else-statements/">C if…else statements</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/c-if-else-statements/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
