float mark[5];
- An array is a pointer
int arr[6]={11,12,13,14,15,16};
: arr is a pointer that stores the address of the first element in the array
- An array is contiguous blocks of memory that store a value
int data[100];
float mark[5];
int *arr[n]; //declares an array of integer with n term
#include<stdio.h>
#include<string.h>
#define MAX 2
struct student
{
char name[20];
int roll_no;
float marks;
};
int main()
{
struct student arr_student[MAX];
int i;
for(i = 0; i < MAX; i++ )
{
printf("
Enter details of student %d
", i+1);
printf("Enter name: ");
scanf("%s", arr_student[i].name);
printf("Enter roll no: ");
scanf("%d", &arr_student[i].roll_no);
printf("Enter marks: ");
scanf("%f", &arr_student[i].marks);
}
printf("
");
printf("Name Roll no Marks
");
for(i = 0; i < MAX; i++ )
{
printf("%s %d %.2f
",
arr_student[i].name, arr_student[i].roll_no, arr_student[i].marks);
}
// signal to operating system program ran fine
return 0;
}
float mark[5];
printf("testing")
Code Example |
---|
C :: c program that replace vowels in a string with char |
C :: c strstr |
C :: how to use malloc in c |
C :: check if pid exists c |
C :: solana-test-validator log |
C :: DrawText() raylib |
C :: dynamic memory allocation c |
C :: selection sort c |
C :: unsigned char c programming |
C :: mongo connect db |
C :: rfid rc522 code |
C :: #define f_cpu |
C :: size of pointer in c |
C :: choose random number with weight |
C :: looping through an array in c |
C :: print in c |
C :: redis service |
C :: finding characters in string |
C :: c program for assignment operator |
C :: getchar declaration in c |
C :: national festivals of india in hindi |
C :: largest value in u64 |
C :: como somar em C |
C :: google business customer care number india 24/7 |
C :: BST or NOT ?? |
C :: Parsing using strtok |
C :: compil cywin cgi |
C :: Chef in Vaccination Queue codechef solution in c++ |
C :: command to perform safe shutdown in unix |
C :: %d and %i |