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
31 comments:
Helpful post...thank you
this program shows segmentation fault in linux...
Thanks alot my brother for helping us....................
thanx
It is realy very helpfull for students
questns bagunayi boss!!!
Thanks
help me to calculate the power by using for loop
#include
using namespace std;
int main()
{
int n,p,temp,i;
int total=0;
cout<<"Enter the number";
cin>>n;
cout<<"power of ";
cin>>p;
temp = n;
for(i=1;i<p;i++)
{
total = temp*n;
temp = total;
}
cout<<temp;
system("PAUSE");
cin.get();
return 0;
}
very helpful
wap to c language
1
22
333
4444
55555
#include
main()
{
int i, j, k = 0;
for(i = 1; i <= 5; i++)
{
++k;
for(j = 1; j <= i; j++)
printf("%d",k);
printf("\n");
}
}
#include
void main()
{
int n,i,j=1,k;
printf("enter n:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(k=1;k<=i;k++)
{
printf("%d",j);
}
printf("\n");
j++;
}
}
#include
int main()
{
int num;
int pow;
int sum =1;
printf("\n enter the number \n");
scanf("%d",&num);
printf("\n enter the power of \n");
scanf("%d",&pow);
fo(;pow;pow--)
sum = sum *num;
printf("\n sum = %d \n", sum);
}
Program to enter the numbers till the user wants and at the end it should display the count of positive, negative and zeros entered.
/****Program to input 10numbers from the user and display whether it is even or odd****/
#include
#include
int main(void)
{
int number_of_terms=10;//Total number of input from user
int number[10];//Array to store the numbers given from users
int i;
printf("Enter 10 integers\n");
for(i=1;i<=10;i++)
scanf("%d",&number[i]);
i=1;
while(i!=(number_of_terms+1))
{
if(number[i]%2==0)
{
printf("%d is Even\n",number[i]);
}
else
{
printf("%d is Odd\n",number[i]);
}
i++;
}
getch();
return 0;
}
Can anyone tell how to return the square of any given number in c...without using math.h,looping mechanisms and * sign..and ya it is possible..not kidding
x^2/m+x^5/m^3+x^8/m^5+x^11/m^7.............
please help........
I=j=1:
while(i<=1)
{
while(j<=i)
{
printf("%d",i);
}
printf("\n");
I++;
}
WAP in c to display follwing o/p....plz help
*
* *
* * *
* * * *
* * * * *
/*
WAP in c to display follwing o/p....plz help
*
* *
* * *
* * * *
* * * * *
*/
#include
void main()
{
int row,col,i,j;
printf("enter the no. of rows and columns\n");
scanf("%d \n %d",&row,&col);
for(i=0;i0)
printf(" ");
else
printf("*");
}
printf("\n");
}
}
#include
void main()
{
int row,col,i,j;
printf("enter the no. of rows and columns\n");
scanf("%d \n %d",&row,&col);
for(i=0;i0)
printf(" ");
else
printf("%d",i+1);
}
printf("\n");
}
}
#include
int main()
{
int x,i,k,j;
printf("Enter any number \n ");
scanf("%d",&x);
for (i=1;i<=x;i++){
for(k=1;k<=i;k++)
printf("*");
for(j=1;j<=k*2;j++)
printf(" ");
printf("\n");}
return 0;
}
for C# how to calculate the power of num
{
int num;
Console.WriteLine("enter the value");
num = Convert.ToInt32(Console.ReadLine());
num = num * num;
Console.WriteLine("power of given no = {0}",num);
Console.ReadLine();
}
A program using for loop to find out X to the power N to the power M
#include
int main(){
int pow1,pow2,num,i;
long int sum1=1,sum2=1;
printf(" Enter a number: ");
scanf("%d",&num);
printf("\n Enter power 1: ");
scanf("%d",&pow1);
printf("\n Enter power 2: ");
scanf("%d",&pow2);
for(i=1;i<=pow1;i++)
{
sum1=sum1*num;
}
for(i=1;i<=pow2;i++)
{
sum2=sum2*sum1;
}
printf("\n%d to the power %d to the power %d is: %ld",num,pow1,pow2,sum2);
return 0;
}
Why you all are taking extra variable?
#include
int main()
{
int i; // you can take this value using scanf also.
for(i = 1; i <= 5; i++)
{
for(int j = 1; j <= i; j++)
{
printf("%d ",i); // print i here
}
printf("\n");
}
return 0;
}
#include
int main()
{
int num,power,i,ans=1;
scanf("%d",&num);
scanf("%d",&power);
for(i=0;i<power;i++);
{
ans=num*ans;
}
printf("%d",ans);
return (0);
}
ans is not coming right
Why does in for loop the formula is power= power * base? What does this mean? Help pls.
Post a Comment