/*A program to show how printf function will work.....what is returns...?*/
#include<stdio.h>
int global,local;
int main()
{
{
int local=5,count=0;
local= printf("\nadd of local=%p &value=%d",&local,*(&local));//it prints value of local variable 5 as initialised ....but when i made local=printf()...it will have count of characters written in printf func
printf("\nhello local=%d",local);//
it has printed 33 bcz character returned by above printf r 33//bcz it will count total no.of character printed either in place of %d or %f...
//printf("\nhello local=%d",local);
count=printf("\nno of characters:=%d local=%d",printf("aaaaie welcome"),local);//here 1st argument will be characters returned by printf function used in the place of variable.i.e.14..2nd arg will be 33...
printf("\ncount is=%d",count);
count=printf("\nno of characters:=%d local=%d",printf("aaaaie welcome=%d",local));//here 1st argument will be characters returned by printf function used in the place of variable.i.e.17..2nd arg will be value of local variable. as 33...local is either variable of printf function which is acting as a variable..but shows output for another main printf..
local=printf("\nhihere",local);//prints only hihere no %d is here but value in local is changed became 7
printf("\nhi i m here=%d",local);//local=7
printf("\nhi i m here=%d",printf("\nin=%d",local));//for in=7 bcz it has 7 value alredy........ hi i m here=5 bcz printf function will return total 5 as a count ...value of local is not modified
printf("\nhi i m here=%d understand local=%d",printf("\ninternal=%d",local),local);//internal=7
//bcz value of local was not changed ....only printf returns diff value which is printed in place of %d...here
//printf returns 11 but value of local=7
printf("now local is=%d",local);//local=7
}
//printf("add of local=%p &value=%d",&local,*(&local));