Need Help? Contact the Espiya Helpdesk. CLICK HERE


Author Topic: HELP naman mga expert sa C Language jan  (Read 1458 times)

FuPand

  • 2007 Bravehearts
  • Active - Two Stars
  • *
  • Posts: 223
  • Karma 2
  • Gender: Male
  • back off hater
HELP naman mga expert sa C Language jan
« on: November 12, 2009, 08:34:41 am »
mga bro,help me naman sa assignment ko..nawala kasi yung notes ko sa for loops.
please mga ka espiya...thanks po ng marami
need ko kasi code snippet nito:

1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7
1 2 3 4 5 6
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1

TJHan

  • 2006 Vanguards
  • Active - Three Stars
  • *
  • Posts: 339
  • Karma 0
  • Gender: Male
Re: HELP naman mga expert sa C Language jan
« Reply #1 on: November 12, 2009, 09:10:33 am »
hahah nsa libro man yan nakalimutan ko lang. yan ang final exam ng interview para teaching position na inaplyan ko.

ganito yan pero vb ibibigay ko na code para mag isip ka pa rin.

for count1 as integer = 10 to 1

     for count2 as integer = 1 to count1
         printf(count2)
         printf(" ")             ' print space
         count2 ++;
     next

printf('\n')          ' next line
Count1 --;
next

the code is wrong, pero ang concept ganito lang for loop within a for loop nakalimutan ko na kasi ang c language
research ka sa syntax sa for loop for c


research ka on your own dahil kun magiging programmer ka, katiting lang ang puzzle na ito sa real world, may mga loopings na ilang levels and recursion pa ang iba

haleer you

  • "Listen to advice and accept correction, then in the end you will be wise."
  • 2009 Cavaliers
  • Active - Top Level
  • *
  • Posts: 7275
  • Karma 11
  • Gender: Male
  • Pure Surigaonon
Re: HELP naman mga expert sa C Language jan
« Reply #2 on: November 12, 2009, 09:55:46 am »
Heto bro same concept using c++

//cout = printf
//cin = scanf



#include<conio.h>
#include<iostream>
using namespace std;

int main()
{
int input, x, y;
cout<<"Enter n Level: ";
cin>>input;

if(input<=9)
{
cout<<"Output: \n\n";
for(x=1; x<=input; x++)
{
for(y=1; y<=x; y++)
{
cout<<x;
}
cout<<endl;
}
}

getch();
}

"Listen to advice and accept correction, then in the end you will be wise."


FuPand

  • 2007 Bravehearts
  • Active - Two Stars
  • *
  • Posts: 223
  • Karma 2
  • Gender: Male
  • back off hater
Re: HELP naman mga expert sa C Language jan
« Reply #3 on: November 12, 2009, 08:54:46 pm »
wala talaga kasi akong idea bro..na brainwash kasi galing sembreak. ngaun na kasi to ipapasa. please nalang..pleasee

RiderX_23

  • 2007 Bravehearts
  • Active - Top Level
  • *
  • Posts: 620
  • Karma 11
  • Gender: Male
Re: HELP naman mga expert sa C Language jan
« Reply #4 on: November 12, 2009, 10:04:33 pm »
Patay nakalimutan ko na yan subject ko na c language... siguro tama sila.... hehehe

Dairycow

  • 2006 Vanguards
  • Active - Top Level
  • *
  • Posts: 2235
  • Karma 16
  • Gender: Male
  • MOOOOOOO!
Re: HELP naman mga expert sa C Language jan
« Reply #5 on: November 13, 2009, 12:55:36 pm »
try mo po ito sir, minsan lang ako mag submit dito, sana naman tumama ako :D

#include<stdio.h>
void main()
{
int a,b,c=1,d=0;
for(a=1;a<9;a++)
{
for(b=9;b>a;b--)
{
d=d+c;
printf("%d",d);
}
printf("\n")
}
}

Dairycow

  • 2006 Vanguards
  • Active - Top Level
  • *
  • Posts: 2235
  • Karma 16
  • Gender: Male
  • MOOOOOOO!
Re: HELP naman mga expert sa C Language jan
« Reply #6 on: November 14, 2009, 06:18:16 am »
pasensya na sir, mali yung code ko sa taas. kasi wala akong compiler para itry.

ito na po final revisions.

#include<stdio.h>
int main()
{
   int a,b,c,d;
   for(a=9;a>=1;a--)
   {
      for(b=1;b<=a;b++)
      {
         
         printf("%d",b);

      }


      printf("\n");
      
   }
}

ito po output



sana nakahabol pa laffman::

haleer you

  • "Listen to advice and accept correction, then in the end you will be wise."
  • 2009 Cavaliers
  • Active - Top Level
  • *
  • Posts: 7275
  • Karma 11
  • Gender: Male
  • Pure Surigaonon
Re: HELP naman mga expert sa C Language jan
« Reply #7 on: November 15, 2009, 06:38:09 am »
pasensya na sir, mali yung code ko sa taas. kasi wala akong compiler para itry.

ito na po final revisions.

#include<stdio.h>
int main()
{
   int a,b,c,d;
   for(a=9;a>=1;a--)
   {
      for(b=1;b<=a;b++)
      {
         
         printf("%d",b);

      }


      printf("\n");
      
   }
}

ito po output



sana nakahabol pa laffman::

toinks nakalimotan yung system("pause")
"Listen to advice and accept correction, then in the end you will be wise."


Dairycow

  • 2006 Vanguards
  • Active - Top Level
  • *
  • Posts: 2235
  • Karma 16
  • Gender: Male
  • MOOOOOOO!
Re: HELP naman mga expert sa C Language jan
« Reply #8 on: November 15, 2009, 08:58:33 am »
hehe..i don't use that much often :D

wolfpaq

  • Active - Two Stars
  • **
  • Posts: 177
  • Karma 0
Re: HELP naman mga expert sa C Language jan
« Reply #9 on: November 15, 2009, 10:00:43 am »
limot ko na ang C programming..

haleer you

  • "Listen to advice and accept correction, then in the end you will be wise."
  • 2009 Cavaliers
  • Active - Top Level
  • *
  • Posts: 7275
  • Karma 11
  • Gender: Male
  • Pure Surigaonon
Re: HELP naman mga expert sa C Language jan
« Reply #10 on: November 19, 2009, 01:50:53 am »
nice, sana meron tayong boards for c and c++ programming
"Listen to advice and accept correction, then in the end you will be wise."


Dairycow

  • 2006 Vanguards
  • Active - Top Level
  • *
  • Posts: 2235
  • Karma 16
  • Gender: Male
  • MOOOOOOO!
Re: HELP naman mga expert sa C Language jan
« Reply #11 on: November 19, 2009, 11:33:23 am »
oo nga sir.