#include
// Add your code here to print numbers from 1
// to N without using any semicolon
int addNumber(int n, int m){
printf("%*d%*d",5,n,8,m);
}
int main()
{
printf("\n%d", addNumber(5,8));
}
We can avoid the leading spaces by using carriage return
// Add your code here to print numbers from 1
// to N without using any semicolon
int addNumber(int n, int m){
printf("%*d%*d",5,n,8,m);
}
int main()
{
printf("\n%d", addNumber(5,8));
}
We can avoid the leading spaces by using carriage return
#include
// Add your code here to print numbers from 1
// to N without using any semicolon
int addNumber(int n, int m){
printf("%*c%*c",5,'\r',8,'\r');
}
int main()
{
printf("\nSum: %d", addNumber(5,8));
}
Note: It will work on code blocks but not in Online Compilers:ideone
Comments
Post a Comment