write a program to print 2 integer, 2 float and 2 charater values
Answers
You said to write a program, but you didn't mention in what programming language(Python, C#, C, C++, JAVA, QBASIC, etc). So I am writing the program in Python language.
Answer -
print( 1, 2) #prints the integer value
print(9.43, 8.1) #prints the float value
print("Apple", "Banana") #prints the character value/
Hope this answer helps, please mark this as the Brainliest, and click the 'Thank' button (please mark me as Brainliest, ok?)
Question
- write a program to print 2 integer, 2 float and 2 charater vvalues
Answer:-
As Code language (like java, python, etc.) is not mentioned in the Question....So I had done in JAVA.
Java code:-
package Coder;
public class printNumber
{
public static void main (String ar[])
{
int a=5,b=6; //declaration and initialisation of variable
float r =3.4F,h=4.5F; //same as above
char c='a',e='b';
//Here comes printing
System.out.println("Integer "+a+". "+b);
System.out.println("Float:- "+r+" "+h);
System.out.println("Character:- "+c+" "+e);
}
}
Variable Description:-
- a and b:- to store integer values
- r and h:- to store decimal values
- c and e :- to store character values