Grade XII Programming in C form set

C Programming Solutions 

#)//factorial number given number using recursion

#) sum upto given number using recursion.

#) fibonacci series using recursion





a) WAP to open new data file to store name and age of student until user says 'no'.


b) WAP to enter radius of football and calculate area of football using user define function.



c. WAP to input staff id ,name and salary of 50 staffs. Display staff id name and salary of those staff whose salary ranges from 25 thousand to 40 thousand.



d. WAP to sort 10 different number using user define function.


e. WAP to input roll, name and age of 5 student and display them using structure.


f. Demonstrate a program in C to create a data file named score.dat to store students' information with Reg no, name, gender, and address. The program should ask the user to continue or not. When finished, the program should also display all the records in the proper format.


# Develop a program in C using a structure to ask for the information of any 12 students with roll_number, name, and marks scored in sub1, sub2, and sub3. Also, display them in proper format along with the calculation of total and percentage. [Note: the full marks of each subject are 100).

#include <stdio.h>
struct Student{
int roll;
char name[50];
float sub1,sub2,sub3,total,per;
};
int main(){
struct Student data[3];
int i;

 for(i=0;i<3;i++){
printf("Enter roll number, name and marks of sub1,sub2,sub3 of %d student\n",i+1);
scanf("%d%s%f%f%f",&data[i].roll,&data[i].name,&data[i].sub1,&data[i].sub2,&data[i].sub3);
 }
 for(i=0;i<3;i++){
data[i].total=data[i].sub1+data[i].sub2+data[i].sub3;
data[i].per= data[i].total/3;
 }
 printf("Roll \t Name \t Sub1 \t Sub2 \t Sub3 \t Total \t Percentage\n");
 for(i=0;i<3;i++){
printf("%d \t %s \t %.2f \t %.2f \t %.2f \t %.2f \t %.2f\n",data[i].roll,data[i].name,data[i].sub1,data[i].sub2,data[i].sub3,data[i].total,data[i].per);

 }
return 0;
}

Comments

Popular posts from this blog

Final Project Report for grade XII

Final Project

COMPUTER SYSTEM