int len = printf("ndjlfi"); //len = 6;
len = printf("a = %d, b = %d",a,b); //len = 12
The return value of printf is the length of the string in "".
int len2 = scanf("%d %d",&a,&b); //After correct assignment of a,b, len2 = 2;
The return value of scanf() is the number of correct input data;