How to write a C Program Structure Example in C Programming Language ?
Solution For C Program ://C Program Structure Example.
#include <stdio.h>
typedef struct {
char name[80];
int chineseScore;
int englishScore;
int mathScore;
int age;
int blood; // 1:A, 2:B, 3:AB, 4:O
} Student;
/*
(1)
void printStudent(char *name, int chineseScore, int englishScore, int mathScore, int age, int blood){
printf("%s:\n", name);
printf("Chinese results: %d\n", chineseScore);
}
(2)
*/
/*
int a;
struct Student a;
*/
void printStudent(Student s){
printf("%s:\n", s.name);
printf("Chinese results: %d\n", s.chineseScore);
}
int main(){
/*
(1)
char name[80] = "Sam";
int chineseScore = 100;
int englishScore = 95;
int mathScore = 80;
int age = 18;
int blood = 1;
printStudent(name, chineseScore, englishScore, mathScore, age, blood);
(2)
*/
Student a = { "Sam", 100, 95, 80, 18, 1 };
printStudent(a);
return 0;
}
Program related to C Programming Language :
- C Program Array Index Example
- C Program String - Alphabet Count Example
- C Program Character toupper() Example
- C Program Array Example: Average
- C Program Array Example: Reverse
- C Program if - while - for Example
- C Program Switch - Case Example
- C Program 0.1 + 0.2 != 0.3 Solved
- C Program if - else if - else Example
- C Program typedef Example
- C Program scanf & gets Example
- C Program Friend & Operator: Point2D Example
- C Program Friend & Operator: Vector Example
- C Program Recursion Example
- C Program File Input & Output Example
- C Program Structure Example-2
- C Program Structure Example
- C Program Pointer Example
- C Program Function Example
- C Program String Example
- C Program String Count Example
- C Program String Example
- C Program Character Example
- C Program Sort Example
- C Program sizeof & memcpy Example
- C Program Array Example
- C Program to Array
- C Program print fill zero & mod/div
- C Program Double, Float Equal
- C Program nested for
- C Program for
- C Program if
- C Program System
- C Program Operation
- C Program to printf & scanf
- Example C Program Cuda Malloc
- C Program Side Length
Learn More :
Example
- C Program String - Alphabet Count Example
- C Program Array Example: Average
- C Program Array Example: Reverse
- C Program Switch - Case Example
- C Program if - else if - else Example
- C Program Friend & Operator: Point2D Example
- C Program Friend & Operator: Vector Example
- C Program Recursion Example
- C Program Structure Example-2
- C Program Pointer Example
- C Program Function Example
- C Program String Example
- C Program Character Example
- C Program sizeof & memcpy Example
- C Program Array Example
- C Program Side Length Example
- C Program Pipes()
- C Program 0-1000 to Ordinary
- C Program Roboturtle
- C Program to Destroys a Mailbox
- C Program to Destroys a semaphore
- C Code for Testing the pH Meter V1.0
- APA 102c test program
- How To Retarget the C Library printf function to the UART.
Structure
- C Program Structure Example-2
- C Program To Make Employee Payment Record Using Structure
- C Program To Store Students Record Using Structure
- Generic stack in C Program
- C Program To Multiply Two Polynomials
- C Program LEXICAL ANALYSER
- C Program Implement Binary Search Tree And Its Traversals
- GJK C Program Example-1
- Adding two polynomial functions C Program Using Structure