#include<stdio.h>
#include<conio.h>
// note: this code does not test for user-input errors!!
int main() {
int array[10],i,n;
printf("enter the number of elements in the array:");
scanf("%d",&n);
for(i=0;i<n;i++) scanf("%d",&array[i]);
printf("the reverse ordered array is :");
for(i=n-1;i>=0;i--) printf("%d",array[i]);
return 0;
}
find even number in array
If you have the series stored in an array, you loop through the array and print each array element in turn. Another possibility is to print out the numbers in the series as you generate them. In that case, you may not need to store anything (depending on the series, of course).
Well maybe you can make another form show() but make its opacity 0 so people wont know the secret behind it, no the other form, make it display the array backwards and use the print dialog to print the hidden form.
maxValue = function (array) {mxm = array[0];for (i=0; i<array.length; i++) {if (array[i]>mxm) {mxm = array[i];}}return mxm;}; i don't know
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
#include<stdio.h> void main() { int *p,n,s=0; printf("Enter Number :"); scanf("%d",&n); for(p=&n;*p>0;p++) { s=s*10+*p%10; *p=*p/10; } printf("Reverse Number=%d",s); }
find even number in array
If you have the series stored in an array, you loop through the array and print each array element in turn. Another possibility is to print out the numbers in the series as you generate them. In that case, you may not need to store anything (depending on the series, of course).
Well maybe you can make another form show() but make its opacity 0 so people wont know the secret behind it, no the other form, make it display the array backwards and use the print dialog to print the hidden form.
maxValue = function (array) {mxm = array[0];for (i=0; i<array.length; i++) {if (array[i]>mxm) {mxm = array[i];}}return mxm;}; i don't know
Use for loop declare string array str[] and string variable l= string length of string array j=l for i=0 to i=l/2 then temp=str[i] str[i]=str[j-1] str[j-1]=temp j=j-1 now print str array it will be reversed
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
/* PROGRAM TO SORT ARRAY ELEMENTS USING BUBBLE SORT*/ #include #include void main() { int i,j,n,t,a[50]; clrscr(); printf("ENTER THE ARRAY SIZE:\n"); scanf("%d",&n); printf("ENTER THE ARRAY ELEMENTS:\n"); for(i=0;i
To print a reverse string in C#, you can use the Array.Reverse method or LINQ. Here's a simple example using Array.Reverse: string original = "Hello, World!"; char[] charArray = original.ToCharArray(); Array.Reverse(charArray); string reversed = new string(charArray); Console.WriteLine(reversed); This code converts the string to a character array, reverses the array, and then creates a new string from the reversed array before printing it.
int youArray[arraysize] = {...};...for (int i = 1; i
The simplest way is probably to read the numbers into an array and then prints each element of the array starting at the last one and moving backwards.
To find the factorial of each element in an array using pointers in C, you can create a function that takes a pointer to the array and its size as parameters. In the function, iterate through the array using pointer arithmetic, calculating the factorial for each element and storing the result back in the same array or a separate array. For calculating the factorial, you can use a simple loop or recursion. Finally, print or return the modified array with the factorials.