Wednesday, May 4, 2016

Structure of Declaring and accessing c 2

#include <stdio.h>
#include <stdlib.h>
#define size 50
struct azmalOne{
char firstName[size];
char lastName[size];
char color[size];
int age;
float height;
float weight;
};
void azmalprint(struct azmalOne azmalThree);
int main(){
 struct azmalOne azmalTwo;
 strcpy(azmalTwo.firstName,"mohammad Azmal");
 strcpy(azmalTwo.lastName,"hossain");
 strcpy(azmalTwo.color,"black");
 azmalTwo.age=25;
 azmalTwo.height=5.2;
 azmalTwo.weight=57;
 azmalprint(azmalTwo);

    return 0;
}
void azmalprint(struct azmalOne azmalThree){
printf("first name - %s\n last name - %s\n color - %s\n age - %d \n height - %f \n weight - %f\n",
       azmalThree.firstName,azmalThree.lastName,azmalThree.color,azmalThree.age,azmalThree.height,azmalThree.weight);
}

Structure of Declaring and accessing C

#include <stdio.h>
#include <stdlib.h>
#define size 50
    struct azmalOne{
    char firstName[size];
    char lastName[size];
    char color[size];
    int age;
    float height;
    float weight;
    };
void azmalprint(struct azmalOne azmalThree);
int main(){
     struct azmalOne azmalTwo={"mohammad Azmal","hossain","black",31,1.72,57};
     azmalprint(azmalTwo);

    return 0;
}
void azmalprint(struct azmalOne azmalThree){
    printf("first name - %s\n last name - %s\n color - %s\n age - %d \n height - %.2f meter \n weight - %.2f kg\n",
           azmalThree.firstName,azmalThree.lastName,azmalThree.color,azmalThree.age,azmalThree.height,azmalThree.weight);
}

Print Birthdate Use Structure C

#include <stdio.h>
#include <stdlib.h>

int main()
{
struct date{
int year;
int month;
int day;
};
struct person {
char name[100];
struct date birthday;
};
struct person friend1;
strcpy(friend1.name,"jake orchar");
friend1.birthday.year=1985;
friend1.birthday.month=12;
friend1.birthday.day=5;
struct person friend2;
strcpy(friend2.name,"tan zhi xin");
friend2.birthday.year=1992;
friend2.birthday.month=8;
friend2.birthday.day=16;
printf(" my friend name is \"%s\", his birth date at %d/%d/%d.\n",
friend1.name,friend1.birthday.day,friend1.birthday.month,friend1.birthday.year);
printf(" Next my friend name is \"%s\", her birth date at %d/%d/%d.\n",
friend2.name,friend2.birthday.day,friend2.birthday.month,friend2.birthday.year);
return 0;
}


Sunday, May 1, 2016

Welcome to AzmalTech

#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Welcome to AzmalTech\n");
    return 0;
}