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
28 comments:
is it possible to perform arithmatic operation using a single variable??????
no and it is posible
eg.a1,a2,a3
here a is the single variable...........
Not arithmetic but unary operators like ++a, +a, !a, ~a etc.
No need to call an external function. main() can itself be called to print numbers from 1-100:
#include
int print(int);
int num = 1;
int main(int num)
{
if(num<=100)
{
printf("%d ",num);
main(num+1);
}
return 0;
}
calling main again and again is not a good idea....its more overheads...
y does writing num++; at place of num+1; does not work??
because it is post increment it passes the current value of num and then only increments it.
meaning
num++ is written as
num=num+1
so if num is 2 and u use num++ then 2 is passed to the called function and then the value of num changes to 3
This is a small code for above problem.
#include
main()
{
static int i=1;
if((printf("%d\n",i++))&& i<=100)
main();
}
do you need static? nice idea here...
we can also use same in main() program
Just type 100 lines of the form
printf("1\n"); .......
printf("100");
Since we are paid by lines of code!!!
Here num is the number of arguments passing from terminal.
Please I want program in c to store any sentence and the convert the sentence in such way that 1st letter of every world is capital and remaining letters in lower case.
Please I want program in c to store any sentence and the convert the sentence in such way that 1st letter of every world is capital and remaining letters in lower case.
Write a C program to print all numbers between a and b (a and b inclusive) using a for loop
nice
#include
int main()
{
static int num=1;
if(num<=100)
{
printf("%d ",num);
num=num+1;
main();
}
else
getch();
return 0;
}
#include
int main()
{
static int num=1;
if(num<=100)
{
printf("%d ",num);
num=num+1;
main();
}
else
getch();
return 0;
}
Print the Sequence [8 12 17 24 28 33 upto 100]
#include
int main()
{
static int num=1;
if(num<=100)
{
printf("%d ",num);
num=num+1;
main();
}
else
getch();
return 0;
}
Errors are occuring
can't we write in java for the above problem ie.,1 to 100, if yes then how
#include
int main()
{
int a=1;
def:
printf("%d",a++);
if(a<=100)
goto def;
return 0;
}
Write a program to find the sum of integers from 51 – 100. You are not allowed to use any
loop.
1se 100 kitney baar 9 aate hai print print kaise karbaaye program bta do plz
#include
int main()
{
int i=1;
while(i<=100)
{
printf("%d\n",i++);
}
return 0;
}
I hai i am vikash i have a confusion
in table i want to counting number in this format so any one can solved this:
1 11 21
2 12 22
3 13 23
4 14 24
5 15 25
6 16 26
7 17
8 18
9 19
10 20
ise hi 100 tak ki counting chahta hu ki 1 to 10 row ban jaye or 11, 11, 21, 31, 41 ye column ban jaye please solve this
#include
main()
{
int n,i,j,k;
for(i=1;i<=10;i++)
{
for(n=0,j=0;n<10;n++,j=10)
printf("%5d",i+j*n);
printf("\n");
}
}
Post a Comment