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 (2254)
 C++ interview questions  C++ Interview Questions (1111)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (646)
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 ?    84 Yes 64 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 ?    11 Yes 7 No
Raj
 
 
 
Answer
# 3
http://www.cprogrammingexpert.com/C/Tutorial/fundamentals/datatypes/data_types.aspx 
Is This Answer Correct ?    0 Yes 4 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 ?    38 Yes 68 No
Laxmi Bose
 
Answer
# 5
I MA KRUNAL PATEL 
Is This Answer Correct ?    10 Yes 43 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 46 No
Carrie
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
why you will give me a job in TCS. TCS 7
20. main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); } Answer:??????   2
what are the static variables HCL 8
whats the use of header file in c?   2
wats the diference btwen constant pointer and pointer to a constant.pls give examples.   9
Write a program to accept a character & display its corrosponding ASCII value & vice versa?   8
what is pointer TCS 1
Is there something we can do in C but not in C++? Declare variable names that are keywords in C++ but not C.   2
The variables are int sum=10,SuM=20; these are same or different?   3
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }   1
what is the difference between exit() and _exit() functions?   2
main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }   4
 
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