ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Programming Languages >> C
 
 


 

 
 C interview questions  C Interview Questions (2266)
 C++ interview questions  C++ Interview Questions (1121)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (651)
Question
write a c program to store and print name,address,roll.no of
a student using structures?
 Question Submitted By :: C
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
#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 ?    89 Yes 67 No
Balaji Ganesh
 
Answer
# 2
#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 ?    13 Yes 7 No
Raj
 
 
 
Answer
# 3
http://www.cprogrammingexpert.com/C/Tutorial/fundamentals/datatypes/data_types.aspx 
Is This Answer Correct ?    0 Yes 6 No
Fasfasdfdsaf
 
Answer
# 4
#include<stdio.h>
#include<string.h>
#include<conio.h>
struct laxmi
{
int rollname;
char name;
char address;
}struct laxmi l;
void main()
{
scanf("%d%c%c",&rollname,name,address);
printf("%d%c%c",roolname,name,address);
}
 
Is This Answer Correct ?    40 Yes 69 No
Laxmi Bose
 
Answer
# 5
I MA KRUNAL PATEL 
Is This Answer Correct ?    10 Yes 44 No
Krunal Patel
 
Answer
# 6
write a program to accept a salesman name and monthly sales
amount and calculate the commision as per the given criteria
SALES COMMISION
<=10000 0
>10000 and <=25000 10% of sales amount
>25000 and <=100000 20% of sales amount
>100000 25% of sales amount
 
Is This Answer Correct ?    9 Yes 47 No
Carrie
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
where does malloc() function get the memory?   1
print ur name 20,000 times without using inbuilt library functions like printf,scanf,gets,puts,getchar or putchar IBM 4
write a c program for greatest of three numbers without using if statment IBM 4
How do I initialize a pointer to a function?   2
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } Find the output CitiGroup 5
How Many Header Files in c? TCS 1
What is information technology.   1
what is the full form of c language Satyam 8
what is the output of the following program? #include<stdio.h> void main() { int x=4,y=3,z; z=x-- -y; printf("\n%d %d %d",x,y,z); }   14
How can we see the Expanded source code and compiled code for our source program in C?   1
write a program which will count occurance of a day between two dates. IonIdea 1
can we print any string without using terminator? Infosys 2
 
For more C Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com