deleted old codes We will hack code again
This commit is contained in:
		@@ -1,18 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int main()
 | 
			
		||||
{
 | 
			
		||||
    double a, b, c;
 | 
			
		||||
 | 
			
		||||
    printf("a degerini giriniz :");
 | 
			
		||||
    scanf("%lf", &a);
 | 
			
		||||
 | 
			
		||||
    printf("b degerini giriniz :");
 | 
			
		||||
    scanf("%lf", &b);
 | 
			
		||||
 | 
			
		||||
    c = a + b;
 | 
			
		||||
 | 
			
		||||
    printf("c = %f\n", c);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,16 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int main(){
 | 
			
		||||
    float f;
 | 
			
		||||
    double d;
 | 
			
		||||
 | 
			
		||||
    printf("float bir deger giriniz:");
 | 
			
		||||
    scanf("%f", &f);
 | 
			
		||||
 | 
			
		||||
    printf("double bir deger giriniz: ");
 | 
			
		||||
    scanf("%lf", &d);
 | 
			
		||||
 | 
			
		||||
    printf("f = %f, d = %f\n", f, d);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,9 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int foo(){
 | 
			
		||||
    printf("I am foo\n");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(){
 | 
			
		||||
    foo();
 | 
			
		||||
}
 | 
			
		||||
@@ -1,26 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int main(){
 | 
			
		||||
    int a;
 | 
			
		||||
 | 
			
		||||
    {
 | 
			
		||||
        int b;
 | 
			
		||||
 | 
			
		||||
        b = 20;
 | 
			
		||||
        a = 10;
 | 
			
		||||
 | 
			
		||||
        printf("a = %d, b = %d\n", a, b); // correct
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    printf("a = %d\n", a); // correct 
 | 
			
		||||
    // printf("b = %d\n", b); // error
 | 
			
		||||
    /**
 | 
			
		||||
     * hwpplayer1@hwpplayer1-Aspire-A315-24P:~/Projects/hwpplayer1/c-course/c-basic$ gcc global-local-variables.c 
 | 
			
		||||
global-local-variables.c: In function ‘main’:
 | 
			
		||||
global-local-variables.c:16:24: error: ‘b’ undeclared (first use in this function)
 | 
			
		||||
   16 |     printf("b = %d\n", b); // error
 | 
			
		||||
      |                        ^
 | 
			
		||||
global-local-variables.c:16:24: note: each undeclared identifier is reported only once for each function it appears in
 | 
			
		||||
     * 
 | 
			
		||||
     */
 | 
			
		||||
}
 | 
			
		||||
@@ -1,16 +0,0 @@
 | 
			
		||||
#include <stdio.h> 
 | 
			
		||||
 
 | 
			
		||||
void foo() 
 | 
			
		||||
{ 
 | 
			
		||||
//   a = 10;   /* geçersiz! */ 
 | 
			
		||||
} 
 | 
			
		||||
 
 | 
			
		||||
int a; 
 | 
			
		||||
 
 | 
			
		||||
int main() 
 | 
			
		||||
{ 
 | 
			
		||||
  a = 10;     /* geçerli */ 
 | 
			
		||||
  printf("%d\n", a);   /* geçerli */ 
 | 
			
		||||
 
 | 
			
		||||
  return 0; 
 | 
			
		||||
} 
 | 
			
		||||
@@ -1,16 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int a;
 | 
			
		||||
 | 
			
		||||
void foo(){
 | 
			
		||||
    a = 10;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(){
 | 
			
		||||
    a = 20;
 | 
			
		||||
    printf("%d\n", a);
 | 
			
		||||
    foo();
 | 
			
		||||
    printf("%d\n", a);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,6 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int main(){
 | 
			
		||||
    printf("Hello World !...\n");
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,20 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int a;
 | 
			
		||||
 | 
			
		||||
void foo()
 | 
			
		||||
{
 | 
			
		||||
    int a;
 | 
			
		||||
 | 
			
		||||
    a = 10; /* yerel olan a */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main()
 | 
			
		||||
{
 | 
			
		||||
    a = 20;            /* global olan a */
 | 
			
		||||
    printf("%d\n", a); /* 20 */
 | 
			
		||||
    foo();
 | 
			
		||||
    printf("%d\n", a); /* 20 */
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,12 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int main(){
 | 
			
		||||
    int a = 10;
 | 
			
		||||
    int b = 20;
 | 
			
		||||
 | 
			
		||||
    printf("a = %d, b = %d\n", a, b);
 | 
			
		||||
    printf("a = %d, b = %d\n", b, a);
 | 
			
		||||
    printf("%d%d\n",a,b);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,7 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int main(){
 | 
			
		||||
    printf("I am main\n");
 | 
			
		||||
 | 
			
		||||
    return 0; // with our without same result will be executed
 | 
			
		||||
}
 | 
			
		||||
@@ -1,19 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int foo(){
 | 
			
		||||
    printf("Foo\n");
 | 
			
		||||
 | 
			
		||||
    return 100;
 | 
			
		||||
 | 
			
		||||
    printf("test\n");   /* unreachable code! */ 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(){
 | 
			
		||||
    int result;
 | 
			
		||||
 | 
			
		||||
    result = foo() * 2;
 | 
			
		||||
 | 
			
		||||
    printf("%d\n", result);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,12 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int main(){
 | 
			
		||||
    int a;
 | 
			
		||||
    int b;
 | 
			
		||||
 | 
			
		||||
    printf("Iki sayi giriniz: ");
 | 
			
		||||
    scanf("%d%d", &a, &b);
 | 
			
		||||
    printf("a = %d, b = %d\n", a, b);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,11 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int main(){
 | 
			
		||||
    int a;
 | 
			
		||||
 | 
			
		||||
    printf("sayi giriniz : ");
 | 
			
		||||
    scanf("%d", &a);
 | 
			
		||||
    printf("Girilen deger : %d\n", a);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,11 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int main(){
 | 
			
		||||
    int a, b;
 | 
			
		||||
 | 
			
		||||
    printf("Bir sayi giriniz: ");
 | 
			
		||||
    scanf("%x", &a);
 | 
			
		||||
    printf("a = %d\n", a);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,19 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int main(){
 | 
			
		||||
    int a;
 | 
			
		||||
 | 
			
		||||
    a = 10;
 | 
			
		||||
 | 
			
		||||
    {
 | 
			
		||||
        int a;
 | 
			
		||||
 | 
			
		||||
        a = 20;
 | 
			
		||||
        printf("%d\n", a);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    printf("%d\n", a);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,13 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
void foo(){
 | 
			
		||||
    printf("foo\n");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(){
 | 
			
		||||
    printf("I am main\n");
 | 
			
		||||
 | 
			
		||||
    foo();
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user