Click here for Old is Gold solution of account class 12
2075 GIE Qn no 1a
Explain if-else control structure with examples
2075 GIE Qn no 2
Write a program to enter 10 integer numbers into an array and display in ascending order
#include<stdio.h>
#include<conio.h>
void main()
{
int num[100], i, j, temp;
printf("\n Enter 10 numbers");
for(i=0;i<10;i++)
{
scanf("%d",&num[i]);
}
for(i=0;i<10;i++)
{
for(j=i+1;j<10;j++)
{
if(num[i]>num[j])
{
temp=num[i];
num[i]=num[j];
num[j]=temp;
}
}
}
printf("\n Printing in assending order");
for(i=0;i<10;i++)
{
printf("\n %d",num[i]);
}
getch();
}
Output
2075 GIE Qn no 3
What is function? Write the advantages of function. Differentiate between library and user-defined function with example.
What is function and advantage of function?
Different between library and user-define function
2075 GIE Qn no 4
Write a program to enter name, post and age of 10 employee’s using structure and display in a proper format
#include<stdio.h>
#include<conio.h>
void main()
{
struct record
{
int id;
char name[30], post[20];
};
struct record a[10];
int i;
printf("\n Enter Employee id, Name and Post of 10 employee");
for(i=0;i<10;i++)
{
scanf("%d%s%s", &a[i].id, a[i].name, a[i].post);
}
for(i=0;i<10;i++)
{
printf("\n Employee id=%d\t Name=%s\t Post=%s", a[i].id, a[i].name, a[i].post);
}
getch();
}
Output



1 Comments
Good Article
ReplyDeletePlease do not enter any spam link on comment box