write a c program to store and print name,address,roll.no of
a student using structures?
Answer Posted / raj
#include<string.h>
#include<conio.h>
#include<stdio.h>
struct student
{
char name[20],adr[5][10];
int no;
}s;
main()
{
int i,j;
clrscr();
scanf("%d",&s.no,printf("enter no of the student:"));
scanf("%s",s.name,printf("enter name of student:"));
printf("enter address(5 lines):\n");
for(i=0;i<=5;i++)
{
j=0;
while((s.adr[i][j++]=getchar())!='\n');
}
printf("\nstudent details are:\n\nRoll.no: %d\n\nName :
%s\n\nadress:",s.no,s.name);
for(i=0;i<=5;i++)
printf("\t%s",s.adr[i]);
getch();
}
| Is This Answer Correct ? | 33 Yes | 28 No |
Post New Answer View All Answers
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com
why programs in c are running with out #include
What is the use of #include in c?
What is an identifier?
How can I read a binary data file properly?
How do you use a 'Local Block'?
What is the heap in c?
void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply
If I have a char * variable pointing to the name of a function ..
What are formal parameters?
Write a code to remove duplicates in a string.
Explain what is the stack?
What are the main characteristics of c language describe the structure of ac program?
What are the two forms of #include directive?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above