Twitter Feed Facebook Google Plus Youtube

Adsense responsive

Recent Post below header

Sunday 28 April 2013

LOVE QUOTES FLOWER WALLPAPER HIGH DEFINITION

LOVE QUOTES FLOWER


LOVE QUOTES FLOWER, hd wallpaper, quotes wallpaper, nice wallpaper, wallpaper 2013, best wallpaper, nature wallpaper, nature wallpaper 2013

HD QUOTES FLOWER WALLPAPER

Friday 12 April 2013

C PROGRAM: TO PASS STRUCTURE TO A FUNCTION AS ARGUMENT USING POINTER

CODING:
#include<conio.h>
#include<stdio.h>
struct stud_record
{
 char name[25];
 char cls[5];
 int roll_no;
};
struct stud_record fun(struct stud_record *p);
void main()
{
 struct stud_record student,*s;
 clrscr();
 s=&student;
 fun(s);
 printf("RECORD ENTERED\nName: %s\n",s->name);
 printf("Class: %s",s->cls);
 printf("\nRoll no. %d",s->roll_no);
 getch();
}
struct stud_record fun(struct stud_record *p)
{
 printf("Enter name: ");
 scanf("%s",p->name);
 printf("Enter class: ");
 scanf("%s",p->cls);
 printf("Enter roll no.: ");
 scanf("%d",&p->roll_no);
 printf("\n\n");
}


CODING
OUTPUT


For any query or suggestion please comment below...

C PROGRAM: TO PRINT STUDENT RECORD USING STRUCTURE POINTER

CODING:
#include<conio.h>
#include<stdio.h>
struct stud_record
{
 char name[25];
 char cls[5];
 int roll_no;
};
void main()
{
 struct stud_record student,*s;
 clrscr();
 s=&student;
 printf("Enter name: ");
 scanf("%s",s->name);
 printf("Enter class: ");
 scanf("%s",s->cls);
 printf("Enter roll no.: ");
 scanf("%d",&s->roll_no);
 printf("\n\n");
 printf("RECORD ENTERED\nName: %s\n",s->name);
 printf("Class: %s",s->cls);
 printf("\nRoll no. %d",s->roll_no);
 getch();
}

CODING
OUTPUT

For any query or suggestion please comment below...