Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Why is it important to memset a variable, immediately after allocating memory to it ?

0 Answers  


6)swap(int x,y) { int temp; temp=x; x=y; y=temp; } main() { int x=2;y=3; swap(x,y); } after calling swap ,what are yhe values x&y?

3 Answers  


what is the output for the code : main() { int i,j; printf("%d %d ",scanf("%d%d",&i,&j)); }

20 Answers   Infosys,


What is the restrict keyword in C?

2 Answers  


What is Memory leakage ?

2 Answers   HCL,


Do you have any idea how to compare array with pointer in c?

0 Answers  


Why we not create function inside function.

0 Answers  


write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.

0 Answers   Subex,


what is meant by flushll() in c programming?

1 Answers  


What is the difference between union and anonymous union?

0 Answers   Hexaware,


Why does everyone say not to use scanf? What should I use instead?

0 Answers  


What is the code in while loop that returns the output of given code?

0 Answers  


Categories