Assign 9
Assign 9
#include<stdio.h>
struct automob {
char name[5];
int year;
char mtr[10];
int qty;
};
void main() {
int i,j,k;
printf("Information of parts between BB1 to CC6:\n\n");
printf("\n\nName\t\tyear(manu.)\t\tmaterial\tquantity\n\n\n");
for(i=0;i<54;i++) {
{
struct crc
{
char name [20];
int age;
int test;
int avg;
} c[20];
int x=0,i=0,j=0,k=0,a=0;
int code,amount=0; char cusacc;
int current_b=0;
printf("Enter how many cricketer data you want to enter ;Limit 20\n");
scanf("%d", &x);
printf("Enter Name, age and avg score and no of test matches for each user respectively:\n");
for (i=0;i<x;i++)
{ printf("\nenter name of%d cricketer is =",a+1);
scanf (" %s", &c[i].name);
printf("\nenter age of cricketer is=");
scanf (" %d",&c[i].age);
printf("\nenter no of test matches=");
scanf (" %d",&c[i].test);
printf("\nenter avg score=");
scanf (" %d",&c[i].avg);}
for(i=0;i<x;i++)
{
printf ("\n\n name of %d cricketer is= %s\t\age of cricketer=%d\t\tno of test matches is= %d\t\tavg
score= %d",a+1,c[i].name,c[i].age,c[i].test,c[i].avg);
}
printf ("Name\t\tAccount Number\n___________________________________________");
}
Q3.
#include<stdio.h>
struct studata
{
int roll;
char name[50];
char depart[50];
char course[20];
int yoj;
}nos[450] = { 03, "Kishor", "IT", "B.tech", 2014,
10, "Mohammad Siraj Alam", "Computer Science", "B.Tech", 2014,
53, "Deepak", "Computer Applications", "BCA", 2013,
13, "Karan", "Mechanical", "Diploma", 2013,
1, "Aakash", "Tool and Die", "Diploma", 2012,
2, "Ramesh", "IT", "B.tech", 2014
};
void student_in_year(int year)
{
int i;
printf("\n\t\tYear of joining : %d\n\n", year);
for (i = 0; i <= 450; i++)
{
if (nos[i].yoj == year)
{
struct acc_holder
{
long int acc_num;
char name[30];
int bal;
} sbi[200] = { 1, "Siraj", 1000000,
2, "Azad", 1233044,
3, "Deepak", 99,
4, "Rihan", 33,
5, "Rahul Khowal", 200000
};
int main()
{
int accnum, amount, code;
printf("\nEnter your account number : ");
scanf("%d", &accnum);
printf("Enter 1 for deposit and 0 for withdrawal : ");
scanf("%d", &code);
if (code)
{
printf("\nEnter amount to be deposit : ");
scanf("%d", &amount);
}
else
{
printf("\nEnter amount to withdraw : ");
scanf("%d", &amount);
}
action(accnum, amount, code);
printf("All members with account balance less than 100 are following : ");
below100();
return 0;
}
void below100()
{
int i;
for (i = 0; i < 200; i++)
{
if (sbi[i].bal < 100 && sbi[i].bal > 0)
{
printf("\nName : %s", sbi[i].name);
printf("\nAccount Number : %d\n\n", sbi[i].acc_num);
}
}
}