ASSIGNMENT-4
Implementing the Datatypes, Variable Declaration, Initialization and
Printing
1) Python Program:
a = 10
b = 3.14
c = "Python"
d = True
print("Integer Example")
print(a)
print("Value:", a)
print("Float Example")
print(b)
print("Value:", b)
print("String Example")
print(c)
print("Value:", c)
print("Boolean Example")
print(d)
print("Value:", d)
2) C Programming:
#include <stdio.h>
int main() {
int a = 10;
float b = 3.14;
char c = 'A';
double d = 5.25;
printf("Integer Example\n");
printf("%d\n", a);
printf("Value: %d\n\n", a);
printf("Float Example\n");
printf("%f\n", b);
printf("Value: %f\n\n", b);
printf("Character Example\n");
printf("%c\n", c);
printf("Value: %c\n\n", c);
printf("Double Example\n");
printf("%lf\n", d);
printf("Value: %lf\n", d);
return 0;
}
3) C++ Programming:
#include <iostream>
using namespace std;
int main() {
int a = 10;
float b = 3.14;
char c = 'A';
string s = "C++";
cout << "Integer Example" << endl;
cout << a << endl;
cout << "Value: " << a << endl << endl;
cout << "Float Example" << endl;
cout << b << endl;
cout << "Value: " << b << endl << endl;
cout << "Character Example" << endl;
cout << c << endl;
cout << "Value: " << c << endl << endl;
cout << "String Example" << endl;
cout << s << endl;
cout << "Value: " << s << endl;
return 0;
}
4) Java Programming:
public class Main {
public static void main(String[] args) {
int a = 10;
float b = 3.14f;
char c = 'A';
String s = "Java";
[Link]("Integer Example");
[Link](a);
[Link]("Value: " + a);
[Link]();
[Link]("Float Example");
[Link](b);
[Link]("Value: " + b);
[Link]();
[Link]("Character Example");
[Link](c);
[Link]("Value: " + c);
[Link]();
[Link]("String Example");
[Link](s);
[Link]("Value: " + s);
}
}
5) JavaScript Programming:
let a = 10;
let b = 3.14;
let c = "JavaScript";
let d = true;
[Link]("Integer Example");
[Link](a);
[Link]("Value:", a);
[Link]("Float Example");
[Link](b);
[Link]("Value:", b);
[Link]("String Example");
[Link](c);
[Link]("Value:", c);
[Link]("Boolean Example");
[Link](d);
[Link]("Value:", d);
Submitted By:
Name: Indu
USN / College: 2AG22CS042 / AITM College, Belagavi
Contact: 9380947735 / indureddyd07@[Link]