Write a program to demonstrate the use of printf and scanf statement to read and print values of variables of different data types.
Answers
Answered by
2
//WA to print the sum of two terms and check if it is equal to 50.0 using the asked conditions.
import java. util. *;
class sabdip45
{
public static void main(String args [])
{
Scanner sc=new Scanner(System. in) ;
System. out. println ("Enter the numbers") ;
double a=sc. nextDouble () ;
double b=sc.nextDouble();
float o=a+b;
if(o==50.0)
System. out. println ("The number is equal to 50.0,true");
else
System. out. println("No, it is not") ;
}}
______
Compiling......
No syntax errors.
__________
HOPE THIS HELPS
import java. util. *;
class sabdip45
{
public static void main(String args [])
{
Scanner sc=new Scanner(System. in) ;
System. out. println ("Enter the numbers") ;
double a=sc. nextDouble () ;
double b=sc.nextDouble();
float o=a+b;
if(o==50.0)
System. out. println ("The number is equal to 50.0,true");
else
System. out. println("No, it is not") ;
}}
______
Compiling......
No syntax errors.
__________
HOPE THIS HELPS
Answered by
26
ANSWER
.................
#include
<stdio.h>
//This is needed to run printf() function.
int main()
{
****************printf
("C Programming");
//displays the content inside quotation return 0; }
.................
#include
<stdio.h>
//This is needed to run printf() function.
int main()
{
****************printf
("C Programming");
//displays the content inside quotation return 0; }
***************************Output
C ProgrammingSimilar questions