Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Example 1 of using structure

Posted By: Layla Hughes     Category: C Programming     Views: 4262

Example 1 of using structure

Code for Example 1 of using structure in C Programming

struct student        \\ A
   {
    char name[30];    \\ B    
    float marks;    \\ C
    }  student1, student2;     \\ D
   
main ( )
{
    struct student student3;    \\ E
    char s1[30];        \\ F
    float  f;            \\ G
    scanf (“%s”, name);    \\ H
    scanf (“ %f”, & f);    \\ I
    student1.name = s1;    \\ J
    student2.marks = f;    \\ K
 printf (“ Name is %s \n”, student1.name);    \\ L
 printf (“ Marks are %f \n”, student2.marks);    \\ M
}
  
Share: 


Didn't find what you were looking for? Find more on Example 1 of using structure Or get search suggestion and latest updates.

Layla Hughes
Layla Hughes author of Example 1 of using structure is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!