1. Write a c program to reverse any number.

2. Write a c program to find out sum of digit of given number.

2. Write a c program to find out sum of digit of given number.

10. Write a c program to find out NCR factor of given number.

11. How to convert string to int without using library functions in c

12. Program in c to print 1 to 100 without using loop

13. C program for swapping of two numbers

14. Program to find largest of n numbers in c

15. Split number into digits in c programming

16. C program to count number of digits in a number

11. How to convert string to int without using library functions in c

12. Program in c to print 1 to 100 without using loop

13. C program for swapping of two numbers

14. Program to find largest of n numbers in c

15. Split number into digits in c programming

16. C program to count number of digits in a number

write a c program to display all even factors of a given number using function in c

ReplyDeletecan u give me a program in c to calculate the series 1+4+25+........+n using double loops

ReplyDeletehow is it possible solution of above example question

ReplyDeletesum=a+~b+1

I don't understand.

ReplyDeleteThis comment has been removed by the author.

ReplyDeletewhat is ~?

ReplyDelete~ is complement operator.

Deleteif a=8 then a=1000(in binary form)

and when we take ~a it becomes=0111(interchange 0's and1's)

now 0001=7

in the above example we have to do (a-b)

a-b= a+(-b)

=a+(~b+1)=a+~b+1

but a & b are integers, how does it convert them to binary form, calculate 2's compliment and return result back in int form???

Deletebut a & b are integers, how does it convert them to binary form, calculate 2's compliment and return result back in int form???

Delete#include

ReplyDeleteint main(){

int a,b,i;

printf("Enter any two integers: ");

scanf("%d%d",&a,&b);

for( i=0;i<b;i++)

{

a--;

}

printf("Sum of two integers: %d",a);

return 0;

}

#include

ReplyDeleteint main(){

int a,b,i;

printf("Enter any two integers: ");

scanf("%d%d",&a,&b);

for( i=0;i<b;i++)

{

a--;

}

printf("Sum of two integers: %d",a);

return 0;

}

Why did we write int on the line 1 (i.e.,into main())

ReplyDeleteWhy did we write int on the line 1 (i.e.,into main())

ReplyDelete