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
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
When is a void pointer used?
What is the difference between mpi and openmp?
Explain what is wrong with this statement? Myname = ?robin?;
What does the characters “r” and “w” mean when writing programs that will make use of files?
Can the “if” function be used in comparing strings?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
Write a program to print "hello world" without using a semicolon?
Is it fine to write void main () or main () in c?
What is the modulus operator?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
Are pointers integer?
Tell me is null always defined as 0(zero)?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
Differentiate between functions getch() and getche().