Write a programme that counts from one to ten, print the value on a separate line for each and include a meaasge of youy choice when the count is 3 and a different message when the count is 7?
danishjoshi111:
Which Language C or C++ ?
Answers
Answered by
1
import java.util.*;
class Choice
{
void main()
{
Scanner sn=new Scanner(System.in);
for(int i =1; i<=10; i++)
{
S.o.pln(i);
if(i==3)
{
S.o.p("enter a message - ");
String s=sn.nextLine();
}
if(i==7)
{
S.o.p("enter a message - ");
s=sn.nextLine();
}
}
}
}
class Choice
{
void main()
{
Scanner sn=new Scanner(System.in);
for(int i =1; i<=10; i++)
{
S.o.pln(i);
if(i==3)
{
S.o.p("enter a message - ");
String s=sn.nextLine();
}
if(i==7)
{
S.o.p("enter a message - ");
s=sn.nextLine();
}
}
}
}
Similar questions
Math,
8 months ago
Computer Science,
8 months ago
Biology,
1 year ago
History,
1 year ago
Physics,
1 year ago
Social Sciences,
1 year ago