C. Input to Output Once Again
Problem linkhttps://algo.codemarshal.org/contests/diu-122-fl16-termwork/problems/C
Score: 1
CPU: 1s
Memory: 512MB
CPU: 1s
Memory: 512MB
Bored with the last problem? You need not worry. To spice things up we are giving you different types of inputs this time - two integers, a double, and a character. Think you can handle them all?
Input
There will be 3 lines of input:
- The first line will contain two integers separated by a single space.
- The second line will contain a number with decimal points.
- The final line will contain a single character.
Output
Like the previous problem, just print the inputs exactly the way you read them.
- First line of the output will contain the two integers. Print a single space between them. There should not be any leading or training spaces.
- In the second line print the decimal number, two digits after decimal point.
- Finally print the character in the 3rd line.
Sample
Input | Output |
---|---|
3 5 3.1415926 P | 3 5 3.14 P |
Solutin
#include<stdio.h> int main() { int a,b; double i; char ch; scanf("%d%d",&a,&b); scanf("%lf",&i); getchar(); ch=getchar(); printf("%d %d\n%.2lf\n%c\n",a,b,i,ch); return 0; }
No comments:
Post a Comment