ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
write the program for maximum of the following numbers?
122,198,290,71,143,325,98
 Question Submitted By :: Aaaa
I also faced this Question!!     Rank Answer Posted By  
 
  Re: write the program for maximum of the following numbers? 122,198,290,71,143,325,98
Answer
# 1
main()
{
int i,j,temp,a[7]={122,198,290,71,143,325,98};
	for(i=0;i<=5;i++)
	   {
	    for(j=0;j<=6;j++)
		{
		 if(a[j]<a[j+1])
		   {
		    temp=a[j];
		    a[j]=a[j+1];
		    a[j+1]=temp;
		    }
		 }
	    }
 printf("%d",a[0]);
 }
 
Is This Answer Correct ?    4 Yes 0 No
Akhilesh Singh
 
  Re: write the program for maximum of the following numbers? 122,198,290,71,143,325,98
Answer
# 2
main()
{
  int i,a[7]={122,198,290,71,143,325,98} , max = a[0] ;
 
	for(i = 0 ; i < 7 ; ++i)
		if(max < a[i])
			max = a[i] ;
	
	printf("%d",max);
}
 
Is This Answer Correct ?    3 Yes 0 No
Sameer.chaudhari
[AMIGA]
 
 
 
  Re: write the program for maximum of the following numbers? 122,198,290,71,143,325,98
Answer
# 3
#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
Mathew Varghese
 
  Re: write the program for maximum of the following numbers? 122,198,290,71,143,325,98
Answer
# 4
#inclufe<stdio.h>
Void main()
{
int a[7];
for(i=0;i<=7;i++)
{
printf("Enter the nos");
scanf("%d",&a[i]);
}
for(i=0;i<=7;i++)
{
if(a[i]>a[i+1])
printf("%d",a[i]);
else
if(a[i]<a[i+1])
printf("%d",a[i+]);
else
if(a[i]==a[i+1])
printf("%d",a[i]);
}
getch();
}
 
Is This Answer Correct ?    0 Yes 0 No
Divya
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is out put of the following code? #include class Base { Base() { cout<<"constructor base"; } ~Base() { cout<<"destructor base"; } } class Derived:public Base { Derived() { cout<<"constructor derived"; } ~Derived() { cout<<"destructor derived"; } } void main() { Base *var=new Derived(); delete var; } Honeywell2
write a program for size of a data type without using sizeof() operator?  7
what is a headerfile?and what will be a program without it explain nan example? Assurgent5
If we have an array of Interger values, find out a sub array which has a maximum value of the array and start and end positions of the array..The sub array must be contiguious. Take the start add to be 4000. For Ex if we have an array arr[] = {-1,-2,-5,9,4,3,-6,8,7,6,5,-3} here the sub array of max would be {8,7,6,5} coz the sum of max contiguous array is 8+7+6+5 = 26.The start and end position is 4014(8) and 4020(5). Microsoft4
print the following using nested for loop. 5 4 3 2 1 1 2 3 4 3 2 1 1 2 1 2 1 1 2 3 4 3 2 1 1 2 3 4 5  5
what are the interview question's in the language c Nipuna1
the number 138 is called well ordered number because the three digits in the number (1,3,8) increase from left to right (1<3<8). the number 365 is not well ordered coz 6 is larger than 5. write a program that wull find and display all possible three digit well ordered numbers. sample: 123,124,125,126,127,128,129,134 ,135,136,137,138,139,145,146,147 148 149,156.......789  3
write a Program to dispaly upto 100 prime numbers(without using Arrays,Pointer) Wipro7
WHY DO WE USE A TERMINATOR IN C LANGUAGE?  2
What's wrong with "char *p; *p = malloc(10);"?  5
Is the C language is the portable language...If yes...Then Why...and if not then what is problem so it is not a Portable language..??? TCS1
number 2 plssssss help !!....using array.. turbo c.. create a program that will accept a number and determine if it is a happy number or an unhappy number.. example: enter a number : 7 7*7=49 then 4 and 9 4*4 and 9*9== 16 + 18 gives you 97 then 9 and 7 9*9 and 7*7 == 81 + 49 gives you 130 then 1 and 3 1*1 and 3*3 == 1 + 9 gives you 10 1*1 gives you 1 sample output: 7= 49= 16+81= 97= 81+49=130 =1+9=10 =1 "7 is a happy number" . if the last number is 2 then the number being inputed is not a happy number.  2
write a program to print the all 4digits numbers & whose squares must me even numbers? Virtusa2
Convert the following expression to postfix and prefix X $ Y Z - M + N + P / Q / (R + S)  2
here is a link to download Let_Us_C_-_Yashwant_Kanetkar  2
#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } } ME5
array contains zeros and ones as elements.we need to bring zeros one side and one other side in single parse. ex:a[]={0,0,1,0,1,1,0,0} o/p={0,0,0,0,0,1,1,1} Motorola7
helllo sir give me some information of the basic information the c as printf ,scanf , %d ,%f and why is the main use of these.  3
write a C code To reverse a linked list Motorola2
suppose we use switch statement and we intilize years name using enum statement like(jan,feb,mar,------dec) we take integer value as an input .question is that the month which we analyz is from 0 to 11 bt if i enter 12 than how he again starts from begning and print jan  1
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com