Compare commits
	
		
			1 Commits
		
	
	
		
			2025-examp
			...
			2025-examp
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| bb718cbaef | 
@@ -1,17 +0,0 @@
 | 
				
			|||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int my_float()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  float f;
 | 
					 | 
				
			||||||
  double d;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  printf("float :");
 | 
					 | 
				
			||||||
  scanf("%f", &f);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  printf("double :");
 | 
					 | 
				
			||||||
  scanf("%lf", &d);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  printf("f = %f, d = %f", f, d);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,8 +0,0 @@
 | 
				
			|||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int foo()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  printf("I am foo\n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,5 +0,0 @@
 | 
				
			|||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void hello() {
 | 
					 | 
				
			||||||
   printf("Hello C Programming Language 2025 Examples\n");
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,6 +0,0 @@
 | 
				
			|||||||
#ifndef HELLO_H
 | 
					 | 
				
			||||||
#define HELLO_H
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void hello();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
@@ -1,15 +0,0 @@
 | 
				
			|||||||
#include "hex_read_scanf.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int hex_scan()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  int a;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  printf("Enter a number : ");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  scanf("%x", &a);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  printf("a = %d\n", a);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,9 +0,0 @@
 | 
				
			|||||||
// hexutil.h
 | 
					 | 
				
			||||||
#ifndef HEXUTIL_H
 | 
					 | 
				
			||||||
#define HEXUTIL_H
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Prompts the user for a hexadecimal number and prints its decimal value.
 | 
					 | 
				
			||||||
// Returns 0 upon successful execution.
 | 
					 | 
				
			||||||
int hex_scan(void);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif // HEXUTIL_H
 | 
					 | 
				
			||||||
@@ -1,12 +0,0 @@
 | 
				
			|||||||
#include "print_example.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int print_example()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    int a = 10, 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,8 +0,0 @@
 | 
				
			|||||||
#ifndef PRINT_EXAMPLE_H
 | 
					 | 
				
			||||||
#define PRINT_EXAMPLE_H
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int print_example();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
@@ -1,20 +0,0 @@
 | 
				
			|||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int print_with_scan()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  int a , b ;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  printf("enter a number\n");
 | 
					 | 
				
			||||||
  scanf("%d", &a);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  printf("enter b number\n");
 | 
					 | 
				
			||||||
  scanf("%d", &b);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  printf("a is %d\n", a);
 | 
					 | 
				
			||||||
  printf("b is %d\n", b);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  printf("a is %d b is %d\n", a, b);
 | 
					 | 
				
			||||||
  printf("b is %d a is %d\n", b, a);
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,12 +0,0 @@
 | 
				
			|||||||
#include "scanf_example.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int my_scan()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  int a;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  printf("enter the a number:");
 | 
					 | 
				
			||||||
  scanf("%d", &a);
 | 
					 | 
				
			||||||
  printf("a number is : %d\n", a);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,8 +0,0 @@
 | 
				
			|||||||
#ifndef SCANF_EXAMPLE_H
 | 
					 | 
				
			||||||
#define SCANF_EXAMPLE_H
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int my_scan();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
@@ -1,13 +0,0 @@
 | 
				
			|||||||
#include "scanf_example_two_numbers.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int scan_two_numbers()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  int a, b;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  printf("enter two numbers:");
 | 
					 | 
				
			||||||
  scanf("%d%d", &a, &b);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  printf("a = %d, b = %d\n", a, b);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,8 +0,0 @@
 | 
				
			|||||||
#ifndef SCANF_EXAMPLE_TWO_NUMBERS_H
 | 
					 | 
				
			||||||
#define SCANF_EXAMPLE_TWO_NUMBERS_H
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int scan_two_numbers();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
@@ -1,13 +0,0 @@
 | 
				
			|||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int addition()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  int a , b , c;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  a = 10;
 | 
					 | 
				
			||||||
  b = 20;
 | 
					 | 
				
			||||||
  c = a + b;
 | 
					 | 
				
			||||||
  printf("C = %d", c);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user