Welcome.please sign up.
By signing up or logging in, you agree to our Terms of serviceand confirm that you have read our Privacy Policy.
Already a member? Go to Log In
Welcome.please login.
Forgot your password
Not registered yet? Go to Sign Up
#include<stdio.h> int main() { FILE *fp; int roll; char name[20]; fp=fopen("n.c","r"); if(fp==NULL) { printf("file not found"); exit(1); } printf("by fscanf"); fscanf(fp,"%s %d",name,&roll); printf("%s %d",name,roll); fclose(fp); }
#include<stdio.h>
int main()
{
FILE *fp;
int roll;
char name[20];
fp=fopen("n.c","r");
if(fp==NULL)
printf("file not found");
exit(1);
}
printf("by fscanf");
fscanf(fp,"%s %d",name,&roll);
printf("%s %d",name,roll);
fclose(fp);