simple c program for 12345 convert 54321 with out using string
Answer Posted / rajan sonvane
#include<stdio.h>
#include<conio.h>
main()
{
int *p,a[5]={1,2,3,4,5},b[5],i=0;
p=a;
while(i<5)
{
b[i]=*(p+4-i);
i++;
}
for(i=0; i<5; i++)
{
printf("%d",b[i]);
}
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Where define directive used?
What is the benefit of using an enum rather than a #define constant?
Explain 'far' and 'near' pointers in c.
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
Write a program to print fibonacci series using recursion?
What is a 'null pointer assignment' error?
What is the difference between struct and typedef struct in c?
What is malloc and calloc?
How do you redirect a standard stream?
Why header file is used in c?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What is the heap?
Write a simple code fragment that will check if a number is positive or negative.
What is int main () in c?
I need testPalindrome and removeSpace
#include