program to find a smallest number in an array
Answer Posted / azhar shaik
int n, i,small,a[30];
clrscr();
pf("enter the no.of elements in an array");
sf("%d",&n);
pf("enter the elements \n");
for(i=0;i<n;i++)
{
pf("a[%d]= ,"i);
sf("%d\n",&ai[i]);
}
pf(" displaty the array elements ");
for(i=0;i<n;i++)
{
pf("%d\t",a[i]);
}
pf("smallest element from an array "):
small=a[0];
for(i=1;i<n;i++)
{
if(small>a[i])
{
small=a[i];
}
pf("smallest element is %d ",small);
getch();
}
hint:pf =print f ,sf =scan f
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
What are actual arguments?
Array is an lvalue or not?
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
What is the code for 3 questions and answer check in VisualBasic.Net?
What is the newline escape sequence?
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
Ow can I insert or delete a line (or record) in the middle of a file?
What does c mean in basketball?
Write a program to maintain student’s record. Record should
not be available to any unauthorized user. There are three
(3) categories of users. Each user has its own type. It
depends upon user’s type that which kind of operations user
can perform. Their types and options are mentioned below:
1. Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record)
2. Super Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record, Delete Single Record)
3. Guest
(Search Record [by Reg. No or Name], View All Records)
When first time program runs, it asks to create accounts.
Each user type has only 1 account (which means that there
can be maximum 3 accounts). In account creation, following
options are required:
Login Name: <6-10 alphabets long, should be unique>
Password: <6-10 alphabets long, should not display
characters when user type>
Confirm Password:
Differentiate between ordinary variable and pointer in c.
What is an example of structure?
which is an algorithm for sorting in a growing Lexicographic order
What are the ways to a null pointer can use in c programming language?
What does int main () mean?