difference of two no's with out using - operator

Answer Posted / gg

Try this....

main()
{
int a,b;
printf("Enter two integers \n");
scanf("%d%d",&a,&b);
printf("The diff is : %d ",a+(~b+1));
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

hi any body pls give me company name interview conduct "c" language only

1659


hi, which software companys will take,if d candidate's % is jst 55%?

1652


Write a program to swap two numbers without using the third variable?

587


What are void pointers in c?

570


Explain what is #line used for?

601






List some of the static data structures in C?

755


main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }

908


What are the disadvantages of c language?

610


What is a string?

658


find the sum of two matrices and WAP for it.

624


Can you assign a different address to an array tag?

691


What is structure in c definition?

565


What is dynamic variable in c?

557


What is the explanation for prototype function in c?

560


how do you execute a c program in unix.

633