Search
 
SCRIPT & CODE EXAMPLE
 

C

c programming language

Dinosaurs love it!
Comment

c language

#include <stdio.h>
#pragma warning (disable:4996)

struct address {
	char city;
	int cCode;
};

typedef struct {
	char mem_name[25];
	char mem_gender;
	char mem_mail;
	int mem_id;
	int mem_ic;
	int mem_num;
	struct address addr;
} member;

int main() {
	FILE* memptr;
	member mem;
	int x;
	memptr = fopen("Member Info.bin", "wb");
	if (!memptr) {
		printf("Unable to open the file, please try again");
	}
	else {
		printf("Enter your details: 
");
		for (x = 0; x < 20; x++) {
			printf("Name > ");
			rewind(stdin);
			scanf("%[^
]", mem.mem_name);

			printf("Gender (M = male, G = female) > ");
			rewind(stdin);
			scanf("%s", mem.mem_gender);

			printf("Member ID > ");
			rewind(stdin);
			scanf("%d", mem.mem_id);

			printf("NRIC (without -) > ");
			rewind(stdin);
			scanf("%d", mem.mem_ic);

			printf("Contact Number > ");
			rewind(stdin);
			scanf("%d", mem.mem_num);

			printf("Email > ");
			rewind(stdin);
			scanf("%[^
]", mem.mem_mail);

			printf("Address > ");
			printf("		 City Name > ");
			rewind(stdin);
			scanf("%s", mem.addr);
			printf("		 City Code > ");
			rewind(stdin);
			scanf("%d", mem.addr);

			fwrite(&mem, sizeof(member), 1, memptr);
		}
		fclose(memptr);
	}

	memptr = fopen("Member Info.bin", "rb");
	for (x = 0; x < 20; x++) {
		fread(&mem, sizeof(member), 1, memptr);
		printf("%s|%s|%d|%d|%d|%s|%s|%d
", mem.mem_name, mem.mem_gender, mem.mem_id, mem.mem_ic, mem.mem_num, mem.mem_mail, mem.addr, mem.addr);
	}
	fclose(memptr);
}
Comment

C language

#include <stdio.h>

int main() {
  printf("Hello, World!
");
}
Comment

c language

C programming language is the mother language of all programming language.
Comment

c language

int can(int[] gas, int[] cost) {
        begin = 0
        sum = 0
        tank = 0
        for( i = 0 to i < gas.size() ) {
            tank = tank + gas[i] - cost[i]
            if(tank < 0) {
                begin = i+1
                sum= sum + tank
                tank=0
            }
        }
        if(sum + tank < 0) {
            return -1
        } else { 
            return start
        }
    }
Comment

PREVIOUS NEXT
Code Example
C :: mysql yyyymm format 
C :: pyinstaller hidden import tensorflow not found 
C :: implement crc using c language 
C :: argparse allow line break 
C :: C fscanf ignore commas 
C :: how to input till end of line in c 
C :: print only last 3 number float in c 
C :: create arrya of chars malloc 
C :: notation of positive in c 
C :: c char to int 
C :: c comment 
C :: how to make two arrays equal in c 
C :: logical operators in c 
C :: declare an array 
C :: bp result system 
C :: len of str vbs 
C :: largest value in u64 
C :: cocktail sort in c 
C :: Minimum Distance between words[AMAZON] 
C :: insertNode 
C :: FILE* fptr = fopen("test", "r"); if (__ (fptr)) { printf("End of file reached"). (42); } 
C :: how to limit tiktok on mikrotik 
C :: c stack 
C :: c program boilerplate code 
C :: How to open terminal cs50 ide 
C :: allocate a array on strings in c 
C :: yt-project annotate_scale 
C :: print octal in c 
C :: dynamic stack in c 
C :: print binary c 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =