TCS
Company
Programming
Program
123
12345
1234567
123456789
print this pattern upto 10 terms..
Read Solution (Total 39)
-
- #include
main()
{
int i,j,n;
printf("enter the no od lines u want");
scanf("%d",&n);
for(i=1;i - 9 years agoHelpfull: Yes(36) No(17)
- #include
int main()
{
int i,j,k;
printf("Enter the odd number upto which you want to print the pattern:");
scanf("%d",&k);
for(i=1;i - 9 years agoHelpfull: Yes(13) No(5)
- //In Java
class Pattern
{
PSVM()
{
for(int i=3;i - 9 years agoHelpfull: Yes(6) No(2)
- #include
int main()
{
int i,j;
for (i = 1 ; i - 9 years agoHelpfull: Yes(4) No(4)
- int j=3;
for(I=1;i=10)
break;
}
}
- 9 years agoHelpfull: Yes(2) No(1)
- The perfect solution for this is ,
123
12345
1234567
here from 123 to 12345 ,2 values are increasing and each row
row 0=10-7 3 nos are printed
row 1=10-5 (10-7-2)
row 3=10-3 (10-7-2*2)
so on till 10 terms 10-(7*2*i)
int main()
{
int i,j,n=10;
for(i=0;i - 8 years agoHelpfull: Yes(2) No(4)
- the above expained only logic bt didnt expain the program
int main()
{
int i,j,n=10;
for(i=0;i - 8 years agoHelpfull: Yes(1) No(1)
- #include
main()
{
int i,j,n=10;
for(i=3;i - 6 years agoHelpfull: Yes(1) No(0)
- what is the correct answer????
- 9 years agoHelpfull: Yes(0) No(0)
- for(i=1;i
- 9 years agoHelpfull: Yes(0) No(0)
- #include
void main()
{
int i,j,k=0;
for(i=1;i - 9 years agoHelpfull: Yes(0) No(2)
- for(int i=1;i
- 9 years agoHelpfull: Yes(0) No(1)
- #include
main()
{
int i,j,n=4;
for(i=1;i - 9 years agoHelpfull: Yes(0) No(2)
- for(i=1;i
- 9 years agoHelpfull: Yes(0) No(2)
- #include
void main()
{
for(int i=3;i - 8 years agoHelpfull: Yes(0) No(1)
- int x=3;
for(int i=1;i - 8 years agoHelpfull: Yes(0) No(1)
- void printPattern()
{
int i,j,count;
for(i=1;i - 7 years agoHelpfull: Yes(0) No(0)
- class check
{
public static void main(String args[])
{
long i=123,j,a,b,c,x;
for(a=1;a - 7 years agoHelpfull: Yes(0) No(0)
- #include
void main()
{
int i,j;
for(i=1;i - 7 years agoHelpfull: Yes(0) No(0)
- #include
int main()
{
int n,i,j,s;
printf("n:");
scanf("%d",&n);
s=0;
for(i=1;i - 7 years agoHelpfull: Yes(0) No(0)
- for(i=2; i
- 7 years agoHelpfull: Yes(0) No(0)
- #include
int main()
{
int i,j,k;
for(k=1;k - 7 years agoHelpfull: Yes(0) No(0)
- #include
int main()
{
int i;
int j=3;
while(j - 7 years agoHelpfull: Yes(0) No(1)
- /* This code is adopted from the solution given
@ http://effprog.blogspot.com/2011/01/spiral-printing-of-two-dimensional.html */
#include
#define R 3
#define C 6
int main()
{int n=3;
for(int i=1;i - 7 years agoHelpfull: Yes(0) No(0)
- #include
int main(){
int n;
scanf("%d",&n);
int, i,count=3;
while(count - 7 years agoHelpfull: Yes(0) No(0)
- #include
#include
int main(int arg,char *args[])
{
int i,j;
for(i=1;i - 7 years agoHelpfull: Yes(0) No(0)
- #include
int main(int argc, char*argv[])
{
int i,j,n;
n=atoi(argv[1]);
for(i=1;i - 7 years agoHelpfull: Yes(0) No(0)
- #include
int main()
{
int i,j,n;
scanf("%d",&n);
for(i=3;i - 7 years agoHelpfull: Yes(0) No(0)
- #include
#include
int main(int argc,char *argv[])
{
int a,b,c,d,e,f,count=1,temp=3;
a=atoi(argv[1]);
for(b=0;b - 7 years agoHelpfull: Yes(0) No(0)
- #include
void main()
{
int i,j,;
clrscr();
for(i=1;i - 6 years agoHelpfull: Yes(0) No(0)
- class Pattt
{
public static void main(String args[])
{
for(int i=3;i - 6 years agoHelpfull: Yes(0) No(0)
- #include
void main()
{
int i,j;
for(i=3;i - 6 years agoHelpfull: Yes(0) No(0)
- #include
int main()
{
int i,j;
for(i=3;i - 6 years agoHelpfull: Yes(0) No(0)
- #include
#include
void main(){int i,j;clrscr();for(i=1;i - 6 years agoHelpfull: Yes(0) No(0)
- #include
void main()
{
int i,j,a,n=5;
for(i=1;i - 6 years agoHelpfull: Yes(0) No(0)
- #include
void main()
{
int i,j;
for( i=3;i - 5 years agoHelpfull: Yes(0) No(0)
- this is the logic for printing the required pattern where n is required number of rows
int printPat(int n)
{
int i,j;
for(i=1;i - 5 years agoHelpfull: Yes(0) No(0)
- #include
int main()
{
int i,j,n=3;
for(i=1;i - 5 years agoHelpfull: Yes(0) No(0)
- void main()
{
int n,l=3,i,j;
scanf("%d",&n);
for(i=0;i - 4 years agoHelpfull: Yes(0) No(0)
TCS Other Question