Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tugas individu looping
#1
Nama           : Dwi Nur Aisah
NIM             : 13180381

Kelas            : TI 13.1A.21 





TUGAS INDIVIDU



LOOPING




a.for
 
#include<stdio.h>
#include<iostream>
#include<conio.h>
void main()
{
 
int a=5;
 
for(int h=1;h<=a;h++){
for(int i=1;i<=h;i++){
cout<<"@";
}
cout<<endl;
}
getch();
}

b.while
 
#include<iostream>
#include<conio.h>
#include<stdio.h>
 
int main(void)
{
int i;
i=-10;
while(i<=0)
{
printf("%d\t",i);
i=i+1;
}
getch();
}

 
c.while do
#include<iostream>
#include<conio.h>
#include<stdio.h>
 
int main(void)
{
int i;
i=-10;
do
{
printf("%d\n",i);
i=i+1;
}
while(i<=0);
getch();
}


Attached Files
.docx   Tugas looping.docx (Size: 46.94 KB / Downloads: 0)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)