Community Sites
Create your own community website and start earning today !
It's Free !
 
Communities Members BookmarksPolls Fresher Jobs Funny Pictures MCA Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Input and Output programs


Posted Date: 14 Jun 2008    Resource Type: Articles/Knowledge Sharing    Category: Computer & Technology

Posted By: Lenin       Member Level: Diamond
Rating:     Points: 1



Input and Output programs

This section contains example programs demonstrating the input and output
functions.

This program uses the scanf function.

#include

main()
{
float a , b , c;
printf("Input two numbers... \n");
scanf("%f%f" , &a , &b);
c = a * b ;
printf("%f times %f = %f\n" , a , b , c);
}

This program combines printf and scanf whereby printf displays the input
from scanf.

#include

main()
{
int i;
printf("%c\n",scanf("%i",i));
}

This program demonstrates the use of getchar and putchar.

#include

main()
{
char ch;

printf("Enter some text (type a period to quit)...\n");

do {
ch = getchar();
putchar(ch+1);
} while (ch != '.');

printf("\n\n");

printf("Enter some text (type a period to quit)...\n");
while ( (ch = getchar()) != '.') putchar(ch-1);

printf("\n\n");
}





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to hack your Nokia Phone and Install unsigned Applications!!!
Previous Resource: Control Loop programs
Return to Discussion Resource Index
Post New Resource
Category: Computer & Technology


Post resources and earn money!
 
Related Resources

Watch TV Channels



Contact Us    Editors    Privacy Policy    Terms Of Use   

SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.