Search
 
SCRIPT & CODE EXAMPLE
 

C

WAP to create Database using array of structure & display it in C

#include <stdio.h>
struct student {
    char firstName[50];
    int roll;
    float marks;
} s[5];

int main() {
    int i;
    printf("Enter information of students:
");

    // storing information
    for (i = 0; i < 5; ++i) {
        s[i].roll = i + 1;
        printf("
For roll number%d,
", s[i].roll);
        printf("Enter first name: ");
        scanf("%s", s[i].firstName);
        printf("Enter marks: ");
        scanf("%f", &s[i].marks);
    }
    printf("Displaying Information:

");

    // displaying information
    for (i = 0; i < 5; ++i) {
        printf("
Roll number: %d
", i + 1);
        printf("First name: ");
        puts(s[i].firstName);
        printf("Marks: %.1f", s[i].marks);
        printf("
");
    }
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: This C Program is used to find the greatest among ten numbers. 
C :: write the data in perticulare memmory loaction in C 
C :: bash sed crop cut file line number 
C :: what to do after autoencoder training 
C :: c# Regex similar wor 
C :: nc,manc 
C :: python adding calculator 
C :: how to make random string in c 
C :: write varriable in file C 
C :: how to compress image in c 
C :: ? : em linguagem C 
C :: email dev Microsoft Outlook 2007 items all aligned left or aligned wrong 
C :: letter in alphabet or not 
C :: Write a c program to add two numbers without using addition operator. 
C :: c arrays 
C :: c code to algorithm converter online 
C :: babel customelement plugins 
Dart :: dart random number 
Dart :: button shape flutter 
Dart :: flutter print type 
Dart :: delete shared preference flutter 
Dart :: rotate IconButton flutter 
Dart :: dart shuffle list 
Dart :: The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try 
Dart :: android application ic_launcher dimmensions 
Dart :: flutter print line char limit 
Dart :: operators in dart 
Dart :: disable flutter listtile 
Dart :: dart remainder 
Dart :: chip widget flutter 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =