D Programming – If Statement

Most of the time, every programmer has the need to compare on or two values of variables in your program. Same as most of the programming languages, Python also has its syntax for the If Statement. In this article, I created a program that uses an if statement after the variables x, and y are declared. I assigned values 10 and 5 to variables x and y respectively.

The program is below:

import std.stdio;

int main(){
	int x = 10, y = 5;
	
	if(x > y){
		write("x is greater than y");
	}
	return 0;
}

Your output should be the same as here:
x is greater than y

Thank you for reading this post.

Don’t forget to leave a comment.
 

Python – If Statement

Most of the time, every programmer feels the need to compare on or two values of variables in your program. Same as most of the programming languages, Python also has its syntax for the If Statement. In this article, I created a program that uses an if statement after the variables x, and y are declared. I assigned values 10 and 5 to variables x and y respectively.

The program is below:

if1

Your output should be the same as here:

if2

Thank you for reading this post.

Don’t forget to leave a comment.