Skip to main content

Student database creation using c language | BLOG |


How to create a program using c language which will store information about students and you can add another students after also and you will be able to search student by his/her roll no.?

ANS:- Here is the code 


(Tip:- Make sure to compile this code and do practice a lot to gain knowledge about programming )


#include<stdio.h>
struct student
{
char name[50];
int roll;
float marks;
};
int main()
{
int i,num,n,choice,flag,j,p,z,ch,r=0,c;
struct student s[50];
do
{
printf("enter the process 1:ADD 2:diplay 3:search ");
    scanf("%d",&ch);
switch(ch)
{
case 1:  
printf("enter no of student\n");
scanf("%d",&z);
r=r+z;
p=r;
printf("enter info\n");
for(i=0;i<p;i++)
{
printf("enter name\n");
scanf("%s",s[i].name);
printf("enter roll no\n");
scanf("%d",&s[i].roll);
printf("enter marks\n");
scanf("%f",&s[i].marks);
}
break;
case 2 :
printf("displaying info\n");
for(i=0;i<p;i++)
{
printf("\n name %s \n",s[i].name);
printf("\n roll %d \n",s[i].roll);
printf("\n marks %f \n",s[i].marks);
}
break;
case 3:   
printf("searching info\n");
printf("enter no\n");
scanf("%d",&num);
for(i=0;i<p;i++)
{
if(num == s[i].roll)
      {
printf("\n name %s \n",s[i].name);
printf("\n roll %d \n",s[i].roll);
printf("\n marks %f \n",s[i].marks);
}
else
{
printf("record not found\n");
}
}
break;
}
printf("Do you want to continue 1-yes 2-no");
scanf(" %d",&c);
}while(c==1);
printf("exit \n");
return 0;

}


used content :-

  • c language 
  • do - while loop
  • for loop
  • main function
  • if else statements


THANK YOU 


LIKE ,SHARE, COMMENT  TO GET MORE INFORMATION

Comments

Popular posts from this blog

Rinku privacy policy

Privacy Policy krg built the Rinku app as a Free app. This SERVICE is provided by krg at no cost and is intended for use as is. This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy. The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which are accessible at Rinku unless otherwise defined in this Privacy Policy. Information Collection and Use For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information. The information that I request will be retained on your device and is not...

first blog

date : 08/02/2020 I created my first blog today. I completed 1st module of artificial intelligence and started module 2. In module 1 introduction to AI is given. AI has many definitions associated with it. The AI  is a way of solving difficult problems. Difficult problems which are done by humans, like brushing teeth, brushing is very complicated process to be done by robot. If power is low or high it can not do work . It is the first time I think how chess game in android works. there are infinite numbers of moves to play. But with help of AI it is actually working . Old chess games at high difficulty level were taking so much time to play one move but now it takes only few seconds.           Humans are able to guess and work. but a program can not do that easily. Programs works  stepwise.    

HOW TO USE GITHUB ? WHAT IS GITHUB ? EVERYTHING YOU NEED TO KNOW ABOUT GITHUB.

DATE :- 09/02/2020 Today, I created  GitHub  account in my PC. it's name is krg72 you can find me there. I was not knowing what is  GitHub . Then I find some information from google . This blog is to give information about  GitHub  properly. Just read it and you will understand why and how  GitHub  is used. In this blog, you will learn: Introduction to GitHub Create repository in GitHub issues extras What is GitHub? Many people come to GitHub because they want to contribute to open source  projects, or they're invited by teammates or classmates who use it for their projects.  Why do people use GitHub for these projects? At its heart, GitHub is a collaboration platform. From software to legal documents, you can count on GitHub to help you do your best work with the collaboration and security tools your team needs. With GitHub, you can keep projects completely private, invite the world to collaborat...