Yazılıma ve Programlamaya Yeni Başlayanlar için Tavsiyeler

Merhabalar, LinkedIn'de gezerken görüp okuduğum, başarılı ve faydalı bulduğum bir blog yazısı :
http://denizkilinc.com/2013/10/10/yazilima-ve-programlamaya-yeni-baslayanlar-icin-tavsiyeler/
Okumaya Devam et

C - Girilen İki Sayı Arasındaki Asal Sayıları Bulan Program




#include <stdio.h>
#include <conio.h>
void main()
{
    int a, b, i, j, flag;
    printf("Enter the starting range and ending ragne for prime numbers:\n");
    scanf("%d%d",&a,&b);
    printf("prime numbers between %d to %d are:\n", a, b);
    for(i=a+1; i<b; ++i)
    {
        flag=0;
        for(j=2; j<=i/2; ++j)
        {
            if(i%j==0)
            {
                flag=1;
                break;
            }
        }
        if(flag==0)
            printf("%d\t", i);
    }
    printf("\n");
    getch();
}



Okumaya Devam et

C - Fonksiyonla Değişkenlerin Değerlerini Değiştirme



#include <stdio.h>
#include <conio.h>

void swap(int*, int*);  /* function declaration using references */

void main()
{
   int a, b;

   printf("Enter value for a and b\n");
   scanf("%d%d",&a,&b);

   printf("Before Swapping\na = %d\nb = %d\n", a, b);

   swap(&a, &b);              /* function call */

   printf("After Swapping\na = %d\nb = %d\n", a, b);

   getch();
}

void swap(int *x, int *y)     /* function definition */
{
   int temp;

   temp = *y;
   *y   = *x;
   *x   = temp;  
}

Okumaya Devam et

Bilgisayarı Kapatma, Yeniden Başlatma ve Oturum Kapatma C Programı

#include <stdlib.h>
#include <stdio.h>
#include<conio.h>

void main()
{
int ch;

printf("\n*******SHUTDOWN MENU*********\n");
printf("1.SHUTDOWN\n2.RESTART\n3.LOGOFF\n4.HIBERNATE\n5.EXIT");
printf("\nEnter choice : ");
scanf("%d",&ch);
switch(ch)
{
case 1:system("shutdown -s");
break;
case 2:system("shutdown -r");
break;
case 3:system("shutdown -l");
break;
case 4:system("shutdown -h");
break;
case 5:exit(1);
break;
default:printf("Wrong Choice");
}
getch();
Okumaya Devam et