Pergunta de entrevista da empresa GGK Tech

Write Logic for below scenario with minimal loops * * * * * * * * * * * * * * * * * * * * *

Respostas da entrevista

Sigiloso

28 de set. de 2017

//Took three loops #include void main(){ int n=5,i,temp1,temp2,dumb=0,x; for(i=n;i>0;i--){ temp1=i; temp2=n; while(temp1>0 && i>=((temp2/2)+1) && dumb==0){ printf("* "); temp1--; } if(i==((temp2/2)+1)){ dumb=1; } x=0; while(i0){ x--; printf("* "); } printf("\n"); } }

Sigiloso

28 de set. de 2017

//Sorry there was some error while copy pasting code from editor. //Took three loops #include void main(){ int n,i,temp1,temp2,dumb=0,x; printf("Enter the Length of pattern: "); scanf("%d",&n); for(i=n;i>0;i--){ temp1=i; temp2=n; while(temp1>0 && i>=((temp2/2)+1) && dumb==0){ printf("* "); temp1--; } if(i==((temp2/2)+1)){ dumb=1; } x=0; while(i0){ x--; printf("* "); } printf("\n"); } }

Sigiloso

5 de mar. de 2018

class RevEachSenWord { public static void main(String args[]) { String Raj="Welcome to GGKTech"; String GGK[]=Raj.split(" "); for(int i=0;i=0;j--) { System.out.printf("%s",Raj.charAt(j)); } System.out.printf(" "); } } }

Sigiloso

24 de out. de 2017

#include #include int main(){ int t=5, flag=0; for(int j=0;j<5;j++){ for(int i=0;i

1