write the program for maximum of the following numbers?
122,198,290,71,143,325,98
Answer Posted / mathew varghese
#include<stdio.h>
void main()
{
int a[10]={122,198,290,71,143,325,98};
int x,i;
x=a[0];
for(i=0;i<=6;i++)
{
if(a[i]>=x)
{
x=a[i];
}
}
printf("Maximum is %d \n",x);
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is c language and why we use it?
What are the valid places to have keyword “break”?
What is a void * in c?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
Describe the steps to insert data into a singly linked list.
Why is main function so important?
What is the use of pointers in C?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
Explain which function in c can be used to append a string to another string?
When can a far pointer be used?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
Explain logical errors? Compare with syntax errors.
What is pragma in c?
How can a program be made to print the line number where an error occurs?
Explain what is the difference between functions getch() and getche()?