MeraForum Community.No 1 Pakistani Forum Community

MeraForum Community.No 1 Pakistani Forum Community (http://www.MeraForum.Com/index.php)
-   C++ (http://www.MeraForum.Com/forumdisplay.php?f=216)
-   -   3rd Class: if Statement In C++ (http://www.MeraForum.Com/showthread.php?t=113232)

Morash 04-09-2014 07:23 PM

3rd Class: if Statement In C++
 


If Statement In C++



The if statement Is Used To Execute Or Ignore A Set Of Statements After Testing A Give Condition.
If The Given Condition Is True The Following Statement Will Be Executed Otherwise Will Be Ignored
And The Control Will Transfer To The Next Statement.


Syntax:

if(condition)
{
Statement1;
}





Example

http://i60.tinypic.com/2it0a4o.jpg





Output (Condition True, Statement Executed)

http://i57.tinypic.com/21j6i4o.jpg





Output (Condition False, Statement Ignored)

http://i60.tinypic.com/1zbqkj8.jpg



AYAZ 04-09-2014 09:24 PM

Re: 3rd Class: if Statement In C++
 
Thanks morash, I am going to try this one.

I have one question, where is else ? like it's if-else ladder? or it's just if statement with printout something and not using else?

Morash 04-09-2014 09:35 PM

Re: 3rd Class: if Statement In C++
 
Ye Simple If Statement Hai Ayaz!
Next If Else, Then Nested If Else Statements Hai, Wo Bhi Share Karing ..

pakeeza 04-10-2014 11:49 AM

Re: 3rd Class: if Statement In C++
 
Good sharing usefull ha ye thnks

Akash 04-10-2014 01:10 PM

Re: 3rd Class: if Statement In C++
 
Thanx For Sharing

AYAZ 04-12-2014 01:28 AM

Re: 3rd Class: if Statement In C++
 
I made this program, took my time.due to one mistake.

I was typing If instead of if .

Case sensitive is something hard to follow in programming languages.

AYAZ 04-12-2014 01:30 AM

Re: 3rd Class: if Statement In C++
 
Morash one thing wanted to ask is that what is the different between int and string

what if we take

string num;

rather than

int num;

Let me know please thanks

Morash 04-12-2014 01:40 AM

Re: 3rd Class: if Statement In C++
 
Case Sensitivity Is Not Hard To Deal With!
Ajkal Jitne Bhi Editors Arahe Hai Os Mai Koi Word Capital Ya Small Likho To Osi Time Indicate Karta Hai ..

Morash 04-12-2014 01:48 AM

Re: 3rd Class: if Statement In C++
 
Quote:

Originally Posted by AYAZ (Post 1933216)
Morash one thing wanted to ask is that what is the different between int and string

what if we take

string num;

rather than

int num;

Let me know please thanks

Agar Ap int Type Variable Loge To Os Mai Ap Just NUMBER He Le Sakte Ho ..
And Agar Ap string Type Variable Loge Os Mai Ap char+int Dono Le Sakte Ho ..
Like String Mai Ap Number Bhi De Sakte Ho And Character Bhi ..

AYAZ 04-12-2014 08:18 PM

Re: 3rd Class: if Statement In C++
 
Quote:

Originally Posted by Morash (Post 1933218)
Agar Ap int Type Variable Loge To Os Mai Ap Just NUMBER He Le Sakte Ho ..
And Agar Ap string Type Variable Loge Os Mai Ap char+int Dono Le Sakte Ho ..
Like String Mai Ap Number Bhi De Sakte Ho And Character Bhi ..

You mean hum int sei input only number lei saktey hie.

Aur string sei hum input main number+character dono lei saktey hie.

Correct?


All times are GMT +5. The time now is 01:33 AM.

Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.