Get 2 Integers an Input. Print the Second Number With Respect to 15 width Spaces From the First Number Using C- Program - Learn Engineering

All the news and updates relevant to Engineering. You can also Write a post here

Breaking

Tuesday, June 9, 2020

Get 2 Integers an Input. Print the Second Number With Respect to 15 width Spaces From the First Number Using C- Program

Question

Get 2 Integers an Input. Print the Second Number With Respect to 15 width Spaces From the First Number

Sample TestCase Expected Output

1. 125 12125            12


2. 789563 42563789563         42563


Answer

#include <stdio.h>

int main()
{
    int num1,num2;
    scanf("%d %d",&num1,&num2);
    printf("%-15d%d",num1,num2);

    return 0;
}

Comment What problem Do you Need...

Follow Us For More...

1 comment: