1
232
34543
4567654
can anyone tell me how to slove this c question

Answers were Sorted based on User's Feedback



1 232 34543 4567654 can anyone tell me how to slove this c question..

Answer / sham

int main()
{
int i,j,k,l=0,n;
printf("Enter the length\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
k=2;
for(j=0;j<i+l;j++)
{
if(i<=j)
{
printf("%d",i+j-k);
k=k+2;
}
else
printf("%d",i+j);
}
l++;
printf("\n");
}
}

Is This Answer Correct ?    13 Yes 5 No

1 232 34543 4567654 can anyone tell me how to slove this c question..

Answer / santhoo035

#include<stdio.h>
void di(int n)
{
int c=0,i,j;
for(i=1;i<n;i++)
{
for(j=i;j<=(2*i-1)+(i-1);j++)
{
if(j<(2*i-1))
{
printf("%d",j);
continue;
}
else if(j==(2*i-1))
c=j;
printf("%d",c--);
}
printf("\n");
}
}
int main()
{
di(5);
}

Is This Answer Correct ?    8 Yes 1 No

1 232 34543 4567654 can anyone tell me how to slove this c question..

Answer / anna

#include <stdio.h>

int main ()
{
int i;
for(i = 1; i <= 5; i++)
{
int k;
for(k = 0; k < 11 - i; k++)
{
printf(".");
}

int j;
for(j = 0; j < i; j++)
{
printf("%d", i + j);
}

for(j -= 2; j >= 0; j--)
{
printf("%d", i + j);
}

printf("\n");
}

return 0;
}

Is This Answer Correct ?    2 Yes 0 No

1 232 34543 4567654 can anyone tell me how to slove this c question..

Answer / anjali

#include <stdio.h>

int main ()
{
int k = 2;
int i, j,l;
for (i = 0; i < 5; i++)
{
for (j = i+1; j < k; j++)
{
printf("%d", j);
}
k = k + 2;
for (l = j - 2; l > i; l--)
{
printf("%d", l);
}
printf("\n");

}

Is This Answer Correct ?    4 Yes 3 No

1 232 34543 4567654 can anyone tell me how to slove this c question..

Answer / karthick

public class Num
{
public static void main(String[] args)
{
for(int i=1;i<=9;i++)
{
for(int l=9;l>=i;l--)
{
System.out.print(" ");
}
for(int j=i;j>=1;j--)
{

System.out.print(j);
if(j==1)
{
for(int k=2;k<=i;k++)
{
System.out.print(k);
}
}

}
System.out.println(" ");
}
System.out.println("-------------------");


for(int m=9;m>=1;m--)
{
for(int n=9;n>=m;n--)
{
System.out.print(" ");
}
for(int o=m;o>=1;o--)
{
System.out.print(o);
if(o==1)
{
for(int r=2;r<=m;r++)
{
System.out.print(r);
}
}

}System.out.println("");
}
}
}

Is This Answer Correct ?    1 Yes 1 No

1 232 34543 4567654 can anyone tell me how to slove this c question..

Answer / vignesh1988i

#include<stdio.h>
#include<conio.h>
void main()
{
int n;
printf("enter the lines :");
scanf("%d",&n);
for(int i=0;i<n;i++)
{
printf("\n");
for(int j=i+1;j<=(2*n+1);j++)
printf("%d",j);
for(int k=2*i;k>i;k--)
printf("%d",k);
}
getch();
}

Is This Answer Correct ?    1 Yes 5 No

Post New Answer

More C Interview Questions

What is maximum size of array in c?

0 Answers  


What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }

0 Answers   Wilco,


void main() { int i=5; printf("%d",i++ + ++i); }

21 Answers   ME,


Write the syntax and purpose of a switch statement in C.

0 Answers   Adobe,


Why doesn't C have nested functions?

2 Answers  






Explain what is wrong with this program statement?

0 Answers  


A array contains dissimilar element how can we count, and A array contains dissimilar element how can we store in another array with out repetition.

4 Answers  


What does sizeof function do?

0 Answers  


Write a C program to fill a rectangle using window scrolling

1 Answers  


What is the purpose of clrscr () printf () and getch ()?

0 Answers  


What will be the output of the following program #include<stdio.h> void main() { int i=20; i-=i+++++i++; printf("%d",i); }

5 Answers  


Explain how do you determine the length of a string value that was stored in a variable?

0 Answers  


Categories