Answer Posted / raj
main()
{
int a[5];
char c[5]={'1','2','3','4','5'};
int i;
for(i=0;i<5;i++)
a[i]=c[i]-'0';
for(i=0;i<5;i++)
printf("%d ",a[i]);
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is && in c programming?
What are the 4 types of functions?
how can I convert a string to a number?
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.
#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); }
What's the right way to use errno?
Write a code to generate a series where the next element is the sum of last k terms.
What is a structure in c language. how to initialise a structure in c?
What does. int *x[](); means ?
Describe how arrays can be passed to a user defined function
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
How can I split up a string into whitespace-separated fields?
How are structure passing and returning implemented?
What is echo in c programming?
Explain modulus operator. What are the restrictions of a modulus operator?