Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how can i get output without inserting any input?

+25 votes
asked Mar 27, 2023 by Java Codes (360 points)

11 Answers

0 votes
answered Mar 28, 2023 by VIKRANT SHARMA PCE19CS192 (140 points)
By giving a value for any datatype variable.
0 votes
answered Mar 28, 2023 by Siddhi Jain Khilosiya (140 points)

You can initialize the variable while you declare it.

For example :

int a=20;

If you initialize the variable there is no need to give input for the same variable.

0 votes
answered Mar 28, 2023 by Kishore Tadepalli (140 points)
by directly giving the vakue at the time of variable initialization
or compile time initialization
0 votes
answered Mar 29, 2023 by براء سعيد الداعور (150 points)
System.out.println();
0 votes
answered Mar 30, 2023 by 2203 A52028 (140 points)
by creating input in the program its self rather than giving input
0 votes
answered Apr 1, 2023 by 320126511125 DONGAVENKATASUMANTH (140 points)
By using system.out.println()
commented Apr 25, 2023 by Abhinav Saxena (100 points)
you can print the output in java using this statement
0 votes
answered Apr 6, 2023 by mishradivyasish (180 points)
Just initializing a variable at the time of declaration or after declaration.
0 votes
answered Apr 9, 2023 by Yeswanth Kumar (140 points)
Assuming you just want output without giving any input you can directly initialize using the assignment operator

if you just want to print something just use print() function if you are working in Python
0 votes
answered Apr 14, 2023 by WX23 (230 points)
Use the following lines to do this in c++:

#include <iostream>

using namespace std;

int main(){

cout<<“Typewhateveryouwantwithinthequotes”<<endl;

return 0;

}
0 votes
answered Apr 17, 2023 by Anmol Upadhyay (220 points)
--- in c programming   

#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();

float a,b,add;

printf("enter the first value:");

scanf("%f",&a);

printf("enter the second value:");

scanf("%f",&b);

add =a+b;

printf('add:%f",add);

getch();

}

               

--- in c++ programming

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

float a,b,add;

cout<<"enter the first value:";

cin>>a;

cout<<"enter the second value:";

cin>>b;

add =a+b;

cout<<"add:"<<add;

getch();

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...