#include stdio.h
#include conio.h
#include string.h
void main(){
char name[15];
int age;
printf("enter name : ");
scanf("%s",name); // please note there is no & sign for char string
printf("enter age : ");
scanf("%d",&age); // note the & sign for the integer
printf("%s\t%d",name,age);
getch();
}//end of main
Result

Please note the & sign difference between char string and integer
No comments:
Post a Comment