Zoho
Interview
Programming
Puzzles
Write a program which should give an output
*
* *
* * *
* * * *
* * *
* *
*
Read Solution (Total 70)
-
- class Program
{
static void Main(string[] args)
{
Console.WriteLine("Print Stars");
for (int i = 1; i - 7 years agoHelpfull: Yes(37) No(11)
- #include
#include
void main()
{
int i,j,k,m,num;
clrscr();
coutnum;
for(k=0;k - 7 years agoHelpfull: Yes(22) No(3)
- import java.util.Scanner;
class Pattern
{
public static void main(String[] args)
{
int i,j,r;
System.out.print("Enter the no.of.rows:");
Scanner in=new Scanner(System.in);
r=in.nextInt();
for(i=1;i - 7 years agoHelpfull: Yes(14) No(1)
- #include
#include
#include
void main()
{
int size=3;
int i,j;
for(i=size;i>=-size;i--){
for(j=size;j>=abs(i);j--)
{ printf("*");}
printf("n");}
getch();
} - 7 years agoHelpfull: Yes(8) No(1)
- #include
int main(void) {
int i,j;
for(i=1;i - 7 years agoHelpfull: Yes(4) No(0)
- #include
int main()
{
int i, j, rows;
// printf("Enter number of rows: ");
scanf("%d",&rows);
for(i=1; i=1; --j)
{
printf("* ");
}
printf("n");
}
return 0;
} - 7 years agoHelpfull: Yes(4) No(9)
- using System;
namespace starprogram
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Print Stars");
for (int i = 1; i - 7 years agoHelpfull: Yes(3) No(1)
- #include
//Compiler version gcc 6.3.0
int main(void)
{
int j=1,k=4;
for (int i =0 ;j>=0 ;){
while(j!=i ) {
printf ("*");
i++;
}
i=0 ;
printf ("n");
if(j - 7 years agoHelpfull: Yes(2) No(1)
- package basic;
public class test4 {
public static void main(String[] args) {
int k=-1;
// TODO Auto-generated method stub
for(int i=0;i3)
k=k+2;
for(int j=0;j=j&&i3)
{
if(j - 7 years agoHelpfull: Yes(2) No(0)
- the code is
#include
#include
int main()
{
int n,i=0,j;
scanf("%d",&n);
for(i=0;i - 7 years agoHelpfull: Yes(2) No(2)
- #include
#include
void main()
{
int i,j;
for(i=1;i - 6 years agoHelpfull: Yes(2) No(1)
- #include
#include
#include
void main()
{
int size=3;
int i,j;
for(i=size;i>=-size;i--){
for(j=size;j>=abs(i);j--)
{ printf("*");}
printf("n");}
getch();
} - 6 years agoHelpfull: Yes(2) No(0)
- #include
int main()
{
int i,j,n,k;
scanf("%d",&n);
for(i=0;i - 7 years agoHelpfull: Yes(1) No(2)
- import java.io.*;
class Pattern
{
public static void main(String[] args)
{
int i,j;
for(i=1;i=1;j--)
{
System.out.print("* ");
}
System.out.println("");
}
}
} - 7 years agoHelpfull: Yes(1) No(0)
- #include
using namespace std;
int main()
{
int rows;
cout > rows;
for(int i = 1; i - 7 years agoHelpfull: Yes(1) No(0)
- #include
#include
void main()
{
int i,j,k,p;
clrscr();
for(i=1;i - 7 years agoHelpfull: Yes(1) No(1)
- #include
void main()
{
int i,j;
for(i=0;i - 7 years agoHelpfull: Yes(1) No(0)
- 7 years agoHelpfull: Yes(0) No(1)
- class Main{
public static void main(String args[]){
int n =4;
for(int i=1;i - 7 years agoHelpfull: Yes(0) No(3)
- for(int j=1;j
- 7 years agoHelpfull: Yes(0) No(1)
- #include
Void main() {
int i, j, t, n=7;
For (i=0;i - 7 years agoHelpfull: Yes(0) No(1)
- #include
int main()
{
int i, j, rows;
scanf("%d",&rows);
for(i=1; i=1; --j)
{
printf("* ");
}
printf("n");
}
return 0;
} - 7 years agoHelpfull: Yes(0) No(0)
- #include
int main()
{
int n,c,k;
printf("enter the number of rowsn");
scanf("%d",&n);
for(c=1;c - 7 years agoHelpfull: Yes(0) No(0)
- public class HelloWorld{
public static void main(String []args){
int s=7;
int v=4;
int tmp_data=0;
String star_data="";
for (int i=1;i - 7 years agoHelpfull: Yes(0) No(0)
- if n=4;
for(int i=1;i - 7 years agoHelpfull: Yes(0) No(0)
- package basic;
import java.util.Scanner;
public class test4 {
public static void main(String[] args) {
int k=-1;
Scanner in=new Scanner(System.in);
int a=in.nextInt();
// TODO Auto-generated method stub
for(int i=0;ia/2)
k=k+2;
for(int j=0;j=j&&ia/2)
{
if(j - 7 years agoHelpfull: Yes(0) No(1)
- import java.util.*;
import java.io.*;
class pattern
{
public static void main(String[] args)
{
for(int i=1;i - 7 years agoHelpfull: Yes(0) No(1)
- #include
#include
#include
void main()
{
int i,j,k=8;
clrscr();
for(i=1;i - 7 years agoHelpfull: Yes(0) No(0)
- #include
using namespace std;
int main(){
int n,i,j,k=1,flag=0;
cin>>n;
for(i=1;i - 7 years agoHelpfull: Yes(0) No(0)
- #include
int main(void) {
int i,j,n;
scanf("%d",&n);
for(i=1;i - 7 years agoHelpfull: Yes(0) No(0)
- #include
void main()
{
int i, j, n;
printf("Enter number of rows: ");
scanf("%d",&n);
for(i=1; i - 7 years agoHelpfull: Yes(0) No(0)
- //THIS LOGIC IS IN JAVA
stars=1;
for(i=1;i - 7 years agoHelpfull: Yes(0) No(0)
- #include
int main(void) {
int i,j;
for(i=0;i - 7 years agoHelpfull: Yes(0) No(0)
- Fill both the jars half each. Half of 5l and 3l is 2.5l and 1.5l. 1.5l + 2.5l= 4l.
- 7 years agoHelpfull: Yes(0) No(0)
- for(i=3;i>=-3;i--)
for(j=3;j>=abs(i);j--)
printf("*");
printf("n"); - 7 years agoHelpfull: Yes(0) No(0)
- int main()
{
int i,j,k,l;
for(i=0;i - 7 years agoHelpfull: Yes(0) No(0)
- #include
int main()
{
int n,i,j,k;
scanf("%d",&n);
for(i=0;i0;j--)
{
printf("* ");
}
printf("n");
}
return 0;
}
ATB :) - 7 years agoHelpfull: Yes(0) No(0)
- #include
int main()
{
int i,j;
for(i=0;i - 7 years agoHelpfull: Yes(0) No(0)
- #include
int main() {
int i,j,k,n=4;
for (int i=0;i=1;j--)
{
printf("*");
}printf("n");
}
} - 7 years agoHelpfull: Yes(0) No(0)
- solve the puzzle
- 7 years agoHelpfull: Yes(0) No(0)
- # include
int main()
{
int i,j;
for(i=0;i - 7 years agoHelpfull: Yes(0) No(0)
- import java.util.Scanner;
public class MainClass
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
//Taking rows value from the user
System.out.println("How many rows you want in this pattern?");
int rows = sc.nextInt();
System.out.println("Here is your pattern....!!!");
//Printing upper half of the pattern
for (int i = 1; i - 7 years agoHelpfull: Yes(0) No(0)
- #include
int main()
{
int i, j, rows;
printf("Enter number of rows: ");
scanf("%d",&rows);
for(i=0; i - 7 years agoHelpfull: Yes(0) No(1)
- #include
void main()
{
int i,j,n=4; //n is the number of stars in the middle line
for(i=0;i0;j--)
printf("* ");
printf("n");
}
} - 7 years agoHelpfull: Yes(0) No(1)
- #include
int main(void) {
int i,j;
for(i=1;i - 7 years agoHelpfull: Yes(0) No(1)
- #include
int main()
{
int i,j;
for(i=0;i0;j--)
{
printf("t*");
}
printf("n");
}
for(i=4;i0;j--)
{
printf("t*");
}
printf("n");
}
return 0;
} - 7 years agoHelpfull: Yes(0) No(0)
- int main()
{
int i,j;
for(i=0;i - 7 years agoHelpfull: Yes(0) No(0)
- #include
void main()
{
int I,j,k;
I=1;
while(I=4){
while(j - 7 years agoHelpfull: Yes(0) No(0)
- #include
int main(){
int n;
scanf("%d",&n);
int i;
for(i=1;i=1;i--){
int t=i;
while(t){
printf("* ");
t--;
}
printf("n");
}
} - 7 years agoHelpfull: Yes(0) No(0)
- class java{
public static void main(String[]args){
for(int i=1;i - 6 years agoHelpfull: Yes(0) No(0)
- void main()
{
int i,n,j;
scanf("%d",&n);
for(k=1;k - 6 years agoHelpfull: Yes(0) No(0)
- #include
main()
{
int i,j,size=3;
for(i=3;i - 6 years agoHelpfull: Yes(0) No(0)
- #include
#include
int main()
{
int n,i,j=0;
scanf("%d",&n);
for(i=1;i0)
{
printf("* ");
j--;
}
printf("n");
}
for(i=n-1;i>=1;i--)
{
j=i;
while(j>0)
{
printf("* ");
j--;
}
printf("n");
}
} - 6 years agoHelpfull: Yes(0) No(1)
- every ans u provide is wrong sucha waste of time
- 6 years agoHelpfull: Yes(0) No(1)
- #include
int main()
{
int i, j, rows;
printf("Enter number of rows: ");
scanf("%d",&rows);
for(i=1; i - 6 years agoHelpfull: Yes(0) No(0)
- Scanner sc=new Scanner(System.in)
int rows=sc.nextInt();
for(int i=1;i - 6 years agoHelpfull: Yes(0) No(0)
- #include
#include
int main() {
int n = 5;
int i, j;
for (i = 1; i < n; i++) {
for (j = 1; j = 0; i--) {
for (j = 1; j - 6 years agoHelpfull: Yes(0) No(0)
- a = int(input("Enter any number: "))
k =1
for i in range(0, a):
for j in range(0,k):
print("* ",end="")
k = k + 1
print()
for m in range(0,a):
for n in range(m,a-1):
print("* ", end="")
print() - 6 years agoHelpfull: Yes(0) No(0)
- for(i=0;i=0;j--)
{
printf("*");
}
printf("n");
}
for(j=3;j>0;j--)
{
for(i=0;i - 6 years agoHelpfull: Yes(0) No(0)
- #include
#include
void main()
{
int a,c,d;
printf("Enter the number of rows....n");
scanf("%d",&d);
clrscr();
for(a=0;a - 6 years agoHelpfull: Yes(0) No(0)
- #include
void main()
{
int i,j,n;
scanf("%d",&n);
fot(i=1;i - 6 years agoHelpfull: Yes(0) No(0)
- import java.util.Scanner;
public class Starpat1
{
public void pat(int n)
{
System.out.println("Here is your Pattern:n");
for (int i=1;i - 6 years agoHelpfull: Yes(0) No(0)
- int main()
{
int i,j;
for(i=0;i - 6 years agoHelpfull: Yes(0) No(0)
- int main()
{
int i,j;
for(i=0;i - 6 years agoHelpfull: Yes(0) No(0)
- class PatternStar
{
public static void main(String []args)
{
for (int i=1;i - 6 years agoHelpfull: Yes(0) No(0)
- #include
#include
unsigned int i,j;
void main()
{
for(i=0;i - 5 years agoHelpfull: Yes(0) No(0)
- Using nested loop
int i=0;j=0;
for(i=1;i - 5 years agoHelpfull: Yes(0) No(0)
- #include iostream
using namespace std;
int main()
{int i,j;
for(i=1;i - 4 years agoHelpfull: Yes(0) No(0)
- #include
int main(){
int num,row,column;
scanf("%d",&num);
for(row=1;row=1;column--){
printf("*");
}
printf("n");
}
} - 3 years agoHelpfull: Yes(0) No(0)
- for(int x = 1; x < 4; x++)
{
for(int y = 1; y = 0; x--)
{
for(int y = 1; y - 2 years agoHelpfull: Yes(0) No(0)
Zoho Other Question