Dosen Pengampu:
Drs.Denny Kurniady
Oleh:
Irma Safitri
22089045
#include <stdio.h>
int main(void)
{
printf("Belajar bahasa C di UNP");
return 0;
}
b.Screenshoot Program
c.Hasil Program
Contoh 2
a.Source Code
#include <stdio.h>
int main(void)
{
printf("Belajar bahasa C di UNP");
printf("Semangat!!!");
return 0;
}
b.Screenshoot Program
c.Hasil Program
Contoh 3.
a.Source Code
#include <stdio.h>
int main(void)
{
printf("Belajar bahasa C di UNP");
printf("\n");
printf("Semangat!!!");
printf("\n");
return 0;
}
b.Screenshoot Program
c.Hasil Program
Contoh 4.
a.Source Code
#include <stdio.h>
int main(void)
{
printf("\t Belajar bahasa C di UNP\n Semangat!!! \n");
return 0;
}
b.Screenshoot Program
c.Hasil Program
Contoh 5.
a.Source Code
#include <stdio.h>
int main(void)
{
int harga = 5000;
float nilai_ip = 3.12;
char huruf = 'A';
return 0;
}
b.Screenshoot Program
c.Hasil Program
Contoh 6.
a.Source Code
#include <stdio.h>
int main(void)
{
int harga = 5000;
float nilai_ip = 3.12;
char huruf = 'A';
return 0;
}
b.Screenshoot Program
c.Hasil Program
Contoh 7.
a.Source Code
#include <stdio.h>
int main(void)
{
int harga;
printf("\n");
printf("Harga barang adalah: %d", harga);
printf("\n");
return 0;
}
b.Screenshoot Program
c.Hasil Program
Contoh 8.
a.Source Code
#include <stdio.h>
int main(void)
{
int harga;
float nilai_ip;
char huruf;
printf("\n");
printf("harga = %d , nilai_ip = %f dan huruf = %c", harga, nilai_ip, huruf);
printf("\n");
return 0;
}
b.Screenshoot Program
c.Hasil Program
Contoh 9.
a.Source Code
#include <stdio.h>
int main(void)
{
int harga;
float nilai_ip;
char huruf;
printf("\n");
printf("harga = %d , nilai_ip = %f dan huruf = %c", harga, nilai_ip, huruf);
printf("\n");
return 0;
}
b.Screenshoot Program
c.Hasil Program
Contoh 10.
a.Source Code
#include <stdio.h>
void main()
{
char s[30];
printf("Enter the String :");
gets(s);
printf("You Entered :%s",s);
}
b.Screenshoot Program
c.Hasil Program
Contoh 11.
a.Source Code
#include <stdio.h>
void main()
{
char str[20];
printf("Enter The String :");
fgets(str,20,stdin);
printf("%s",str);
}
b.Screenhsoot Program
c.Hasil Program
Contoh 12.
a.Source Code
#include <stdio.h>
#include <string.h>
int main ()
{
char name[50];
return 0;
}
b.Screenshoot Program
c.Hasil Program