0% found this document useful (0 votes)
40 views27 pages

Elixir Academy GRADE: XI (2078 Batch) Project Work of Computer

This document contains 20 questions related to C programming. It includes questions on data types, conditional statements, loops, functions, arrays and matrices. The questions cover basic as well as some advanced concepts in C programming like Fibonacci series, sorting arrays, string handling, 2D arrays etc. This appears to be a collection of practice questions given as a project to students of class 11.

Uploaded by

Kurban Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views27 pages

Elixir Academy GRADE: XI (2078 Batch) Project Work of Computer

This document contains 20 questions related to C programming. It includes questions on data types, conditional statements, loops, functions, arrays and matrices. The questions cover basic as well as some advanced concepts in C programming like Fibonacci series, sorting arrays, string handling, 2D arrays etc. This appears to be a collection of practice questions given as a project to students of class 11.

Uploaded by

Kurban Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

ELIXIR ACADEMY

GRADE : XI { 2078 Batch }


PROJECT WORK OF COMPUTER

…………………………… ……………………………….

APPROVED BY : SUBMITTED BY :
Question No 1

#include <stdio.h>

#include <conio.h>

void main()

int n;

printf("Enter an integer: ");

scanf("%d",&n);

if ( n & 1)

printf("%d is an odd number", n);

else

printf("%d is an even number", n);

getch();

}
QUESTION NO 2

#include <stdio.h>

#include <conio.h>

void main()

int A, B, C;

printf("Enter the numbers A, B and C: ");

scanf("%d %d %d", &A, &B, &C);

if (A >= B && A >= C)

printf("%d is the largest number.", A);

if (B >= A && B >= C)

printf("%d is the largest number.", B);

if (C >= A && C >= B)

printf("%d is the largest number.", C);

getch();

}
QUESTION NO 3

#include <stdio.h>

#include <conio.h>

void main()

int A;

printf("Enter the number A: ");

scanf("%d", &A);

if (A > 0)

printf("%d is positive.", A);

else if (A < 0)

printf("%d is negative.", A);

else if (A == 0)

printf("%d is zero.", A);

getch();

}
QUESTION NO 7

#include<stdio.h>
#include<conio.h>
main()
{
int ch;

printf("Input any number from 1 to 7=");


scanf("%d",&ch);

switch(ch)
{
case 1:printf("Today is Sunday");
break;
case 2:printf("Today is Monday");
break;
case 3:printf("Today is Tuesday");
break;
case 4:printf("Today is Wednesday");
break;
case 5:
printf("Today is Thursday");
break;
case 6:printf("Today is Friday");
break;
case 7:printf("Today is Saturday");
break;
default:
printf("invalid input");
}
getch();
}

QUESTION NO 4
#include<stdio.h>
#include<conio.h>
void main()
{
float sa,ca;
printf("\n Enter the sales amount");
scanf("%f", &sa);
if(sa<5000)
{
ca=sa*5/100;
printf("\n Commission amount= %f", ca);
}
else if(sa<=5000&&sa<10000)
{
ca=sa*10/100;
printf("\n Commission amount= %f", ca);
}
else
{
ca=sa*15/100;
printf("\n commission amount= %f", ca);
}
getch();
}
QUESTION NO 18

#include<stdio.h>
#include<conio.h>
void main ()
{
printf("\n5");
printf("\n55");
printf("\n555");
printf("\n5555");
printf("\n55555");
getch();
}

QUESTION NO 13
#include<stdio.h>

#include<conio.h>

#include<math.h>

void main ()

int i=1,a,j;

printf("ENTER THE NUMBER OF TERMS YOU WANT\n")

scanf("%d",&a)

do

j=pow(2,i)-1;

printf(%d",j);

i++;

} while (i<=a);

getch();

QUESTION NO 5

#include <stdio.h>
#include <conio.h>

void main()

float subject_1, subject_2, subject_3, subject_4, subject_5;

float total, average, percentage;

char grade;

printf("Enter the marks of five subjects::\n");

scanf("%f%f%f%f%f", &subject_1, &subject_2, &subject_3, &subject_4, &subject_5);

total = subject_1 + subject_2 + subject_3 + subject_4 + subject_5;

average = total / 5.0;

percentage = (total / 500.0) * 100;

if (average >= 80)

division = 'Distinction';

else if (average >= 60 && average < 80)

division = 'First';

else if (average >= 45 && average < 60)

division = 'Second';

else if (average >= 32 && average < 45)

division = 'Third';

else

division = 'Fail';

printf("\nThe Total marks is: \t%.2f / 500.00\n", total);

printf("\nThe Average marks is:\t%.2f\n", average);

printf("\nThe Percentage is: \t%.2f%%\n", percentage);

printf("\nThe Grade is: \t'%c'\n", grade); getch(); }

QUESTION NO 14
#include<stdio.h>

#include<conio.h>

void main()

int n,i=1;

printf("Enter the range of number(Limit):");

scanf("%d",&n);

while(i<=n)

printf("%d ",i*i*i);

i++;

QUESTION NO 9
#include <stdio.h>

#include <conio.h>

void main()

int counter;

printf("Even numbers between 1 to 100\n");

for(counter = 1; counter <= 100; counter++)

if(counter%2 == 0)

printf("%d ", counter);

getch();

QUESTION NO 10
#include <stdio.h>

#include <conio.h>

void main()

for(int i=1;i<=100;i++)

if(i%2==1)

printf("%d\n", i);

getch();

QUESTION NO 25
#include <stdio.h>

int main() {

int r, c, a[100][100], b[100][100], sum[100][100], i, j;

printf("Enter the number of rows (between 1 and 100): ");

scanf("%d", &r);

printf("Enter the number of columns (between 1 and 100): ");

scanf("%d", &c);

printf("\nEnter elements of 1st matrix:\n");

for (i = 0; i < r; ++i)

for (j = 0; j < c; ++j) {

printf("Enter element a%d%d: ", i + 1, j + 1);

scanf("%d", &a[i][j]);

printf("Enter elements of 2nd matrix:\n");

for (i = 0; i < r; ++i)

for (j = 0; j < c; ++j) {

printf("Enter element b%d%d: ", i + 1, j + 1);

scanf("%d", &b[i][j]);

// adding two matrices

for (i = 0; i < r; ++i)

for (j = 0; j < c; ++j) {


sum[i][j] = a[i][j] + b[i][j];

// printing the result

printf("\nSum of two matrices: \n");

for (i = 0; i < r; ++i)

for (j = 0; j < c; ++j) {

printf("%d ", sum[i][j]);

if (j == c - 1) {

printf("\n\n");

return 0;

QUESTION NO 12
#include<stdio.h>

#include<conio.h>

void main()

float p,r,t,si;

printf("Input principle, Rate of interest & time to find simple interest: \n");

scanf("%d%d%d",&p,&r,&t);

si=(p*r*t)/100;

printf("Simple interest = %d",si);

getch();

QUESTION NO 19

#include <stdio.h>
void main()

int arr[10];

int i;

printf("\n\nRead and Print elements of an array:\n");

printf("-----------------------------------------\n");

printf("Input 10 elements in the array :\n");

for(i=0; i<10; i++)

printf("element - %d : ",i);

scanf("%d", &arr[i]);

printf("\nElements in array are: ");

for(i=0; i<10; i++)

printf("%d ", arr[i]);

printf("\n");

QUESTION NO 22

#include <stdio.h>
#include <conio.h>

void main()

int i,sal[200],count=0;

for(i=0;i<200;i++)

printf("enter the salary");

scanf("%d",&sal[i]);

for(i=0;i<200;i++)

if(sal[i]>5000&sal[i]<=10000)

count++;

printf("totalnumbers=%d,count");

getch();

QUESTION NO 6
#include <stdio.h>

#include <conio.h>

void main()

char name[100];

int age;

float salary;

printf("enter name:");

gets(name);

printf("enter age");

scanf("%d,&age);

printf("enter salary:");

scanf("%f,&salary);

printf("Name=%s",name)

printf("\n age=%d\n salary=%2f"age,salary);

getch();

QUESTION NO 15

#include <stdio.h>
#include <conio.h>

void main()

int a=0,b=1,c,n,i;

printf("enter the how many numbers"); scanf("%d",&n);

printf("%d,%d",a,b);

for(i=0;i<n-2;i++)

c=a+b;

printf("%d",c);

a=b;

b=c;

getch();

QUESTION NO 11

#include <stdio.h>

#include <conio.h>
void main()

int n, i;

printf("Enter an integer: ");

scanf("%d", &n);

for (i = 1; i <= 7; ++i) {

printf("%d * %d = %d \n", n, i, n * i);

getch();

QUESTION NO 8

#include <stdio.h>

#include <conio.h>

void main()
{

int a=5,b=12,choice

print("enter choice 1,2 or 3");

scanf("%d",&choice);

switch(choice)

case 1:

printf("sum of a and b = %d",a+b);

break;

case 2:

printf("difference between a and b = %d",a-b);

break;

case 3:

printf("multiplication of a nad b = %d",a*b);

break;

defult:

printf("enter correct number");

break:

getch();

QUESTION NO 24

#include <stdio.h>
#include <conio.h>
void main()
{
int i,j,num[10],temp
for(i=0;i<10;i++)
{
printf("Enter The Number:");
scanf("%d",&num[i]);
}
for(i=0;i<10;i++)
{
for(j=0;j<10;j++)
{
if(num[j]>num[j+1])
{
temp=num[j];
num[j]=num[j+1];
num[j+1]=temp;
}
}
}
printf("the sorted numbers in ascending order
are\n");
for(i=0;i<10;i++)
{
printf("%d\t",num[i]);
}
getch();
}

QUESTION NO

#include <stdio.h>

#include <conio.h>

void main()

{
float salary[40],sum=0.0,avg;

int i;

for(i=0;i<100;i++)

printf("enter the salary%d=,i+1");

scanf("%f",&salary[i]);

for(i=0;i<40;i++)

sum=sum+salary[i];

avg=sum/100;

printf("the sum of salary's =%f and its average=%f",sum,avg));

getch();

QUESTION NO 20

#include <stdio.h>

#include <conio.h>

void main()

{
float eng, phy, chem, math, comp;

float total, average, percentage;

printf("Enter marks of five subjects: \n");

scanf("%f%f%f%f%f", &eng, &phy, &chem, &math, &comp);

total = eng + phy + chem + math + comp;

average = total / 5.0;

percentage = (total / 500.0) * 100;

printf("Total marks = %.2f\n", total);

printf("Average marks = %.2f\n", average);

printf("Percentage = %.2f", percentage);

getch;

QUESTION NO 16

#include <stdio.h>

#include <conio.h>

void main()

{
int i;

for(i=1;i<=20;i=i*3) {

printf("%d\t",i); }

getch();

QUESTION NO 23

#include <stdio.h>

#include <conio.h>

void main()

int a[10];
int i;

int greatest;

printf("Enter ten values:");

for (i = 0; i < 10; i++)

scanf("%d", &a[i]);

greatest = a[0];

for (i = 0; i < 10; i++) {

if (a[i] > greatest) {

greatest = a[i];

printf("Greatest of ten numbers is %d", greatest);

getch();

You might also like