Can you write and get output for C program without using printf and scanf statements? If Yes, How?

Questions by sampathk

Showing Answers 1 - 6 of 6 Answers

umar

  • Jul 25th, 2007
 

programming c,we can use getc(),putc(),gets() and puts() function to input get and put.

  Was this answer useful?  Yes

baseersd

  • Jul 26th, 2007
 

You can also use functions like fprintf(),fputs(),gets(),fgets() instead of printf() and scanf().

Here is a sample example

#include<stdio.h>

int main()
{
  char name[20]="";
  char city[20]="";
  puts("nEnter the name and city");
  gets(name);
  fgets(city,20,stdin);
 fprintf(stdout,"You entered name as %s",name);
 fputs("ncongrats",stdout);
  getch();  
}


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions