Write a program to read three integers from the keyboard using one scanf statement and output
them on the line using:
(a) three printf statements,
(b) only one printf with conversion specifiers, and
(c) only one printf without conversion specifiers.
#include <stdio.h>
void main()
{
int a,b,c;
printf("Enter three integer number:");
scanf("%d %d %d",&a,&b,&c);
printf("%d",a);
printf(" %d",b);
printf(" %d",c);
printf(" %d %d %d",a,b,c);
getch();
}
them on the line using:
(a) three printf statements,
(b) only one printf with conversion specifiers, and
(c) only one printf without conversion specifiers.
#include <stdio.h>
void main()
{
int a,b,c;
printf("Enter three integer number:");
scanf("%d %d %d",&a,&b,&c);
printf("%d",a);
printf(" %d",b);
printf(" %d",c);
printf(" %d %d %d",a,b,c);
getch();
}
No comments:
Post a Comment