0% found this document useful (0 votes)
18 views4 pages

HW1

The document contains a series of C programming exercises and questions, each demonstrating different programming concepts such as variable declaration, input/output operations, mathematical calculations, and conversions. Each exercise includes code snippets that prompt the user for input and display results based on the calculations performed. Overall, it serves as a practical guide for learning basic programming in C.

Uploaded by

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

HW1

The document contains a series of C programming exercises and questions, each demonstrating different programming concepts such as variable declaration, input/output operations, mathematical calculations, and conversions. Each exercise includes code snippets that prompt the user for input and display results based on the calculations performed. Overall, it serves as a practical guide for learning basic programming in C.

Uploaded by

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

//Name : Mohamed Jamil Saeed Ahmed . AC.

NO: 202470034
//Exercise 1
//#include<stdio.h>
//int main(){
// int float =12;
// printf("%d", float);
// return 0; //The output is error,because the name of the function is (float);
//}
// #include<stdio.h>
//int main(){
// char s='e';
// printf("hello\n");
// printf(",the val is %d",printf("%c",s));
// // it will print hello , after that will print the character e , after will
print a value
// return 0;
//
//}
//Exercise 2
//#include<stdio.h>
//int main(){
// int a;
// char r;
// printf("Enter a character \n");
// scanf("%c",&r);
// printf("Enter a number \n");
// scanf("%d",&a);
//
// printf("a=%d\t r=%c\n",a,r);
// return 0;
//}
//Exercise 3
// #include<stdio.h>
//int main(){
// float s1;
// float s2;
// float s3;
// float sum;
// float pre ;
// printf("Type your drgree of 3 subjects \n");
// scanf("%f",&s1);
// scanf("%f",&s2);
// scanf("%f",&s3);
// sum=s1+s2+s3;
// printf("the sum of yor degree = %0.2f\n",sum);
// pre=sum/3;
// printf("the prcentage of yor degree %%%0.2f ", pre);
// return 0;
//}
//Exercise 4
// #include<stdio.h>
//int main(){
// float s1;
// float s2;
// float s3;
// printf("Type 3 numbers \n");
// scanf("%f",&s1);
// scanf("%f",&s2);
// scanf("%f",&s3);
// printf("the subtraction of the numbers = %0.2f-%0.2f-%0.2f=%0.2f\
n",s1,s2,s3,s1-s2-s3);
// return 0;
//
//}
//Exercise 5
// #include<stdio.h>
//int main(){
// int x;
// printf("type a decimal number to convert it to octal & hexadecimal\n");
// scanf("%d",&x);
// printf("The hexadecimal you have entered is %X\n",x);
// printf("The ocatal you have entered is %o\n",x);
//}
//Exercise 6
// #include<stdio.h>
//int main(){
// float r;
// float area;
// float cir;
// printf("****Enter the radius of the circle****\n");
// scanf("%f",&r);
// area=r*r*3.14;
// cir=2*3.14*r;
// printf("The area of the circle = %0.2f\n ",area);
// printf("The circumference of the circle = %0.2f ",cir);
// return 0;
//}
//Exercise 7
// #include<stdio.h>
//int main(){
// long double b;
// printf("b=%d Bytes\n",sizeof(long double));
// return 0;
//}
//Exercise 8
// #include<stdio.h>
//int main(){
// float c;
// float f;
// printf("Enter the temperature in celsius\n");
// scanf("%f",&c);
// f=(c*1.8)+32;
// printf(" the temperature in fahrenheit = %0.2f F\n",f);
//
// return 0;
//}
//Exercise 9
// #include<stdio.h>
//int main(){
// int a,b;
// printf("enter the first number please \n ");
// scanf("%d",&a);
// printf("enter the second number please \n ");
// scanf("%d",&b);
// int r=(a*b)+(3*a)-b;
// int z=a+b+r;
// printf("The values are\n r =%d\n z=%d\n",r,z);
// printf("\t\tThe end of the program\n");
// return 0;
//}
//Question 1
// #include<stdio.h>
//int main(){
// float a,b;
// printf("enter the two numbers please \n ");
// scanf("%f",&a);
// scanf("%f",&b);
// printf("The production of the numbers %0.2f*%0.2f =%0.2f\n",a,b,a*b);
// printf("The division of the numbers %0.2f/%0.2f =%0.2f\n",a,b,a/b);
// return 0;
//
//}
//Question 2
// #include<stdio.h>
//int main(){
// float a,b;
// printf("***The Area of Parallelogram**** \n ");
// printf("please, type the hieght of it \n ");
// scanf("%f",&a);
// printf("please, type base of it \n ");
// scanf("%f",&b);
// printf("The area of Parallelogram = %0.2f*%0.2f =%0.2f\n",a,b,a*b);
// return 0;
//
//}
//Question 3
// #include<stdio.h>
//int main(){
// float a,b;
// float area;
// printf("***The Area of Triangle**** \n ");
// printf("please, type the hieght of it \n ");
// scanf("%f",&a);
// printf("please, type base of it \n ");
// scanf("%f",&b);
// area=a*b*0.5;
// printf("The area of Triangle = %0.2f\n",area);
// return 0;
//
//}
//Question 4
// #include<stdio.h>
//int main(){
// float a,b;
// float area;
// printf("***The Area of Rectangle **** \n ");
// printf("please, type the hieght of it \n ");
// scanf("%f",&a);
// printf("please, type width of it \n ");
// scanf("%f",&b);
// area=a*b;
// printf("The area of rectangle = %0.2f\n",area);
// return 0;
//
//}
//Question 5
// #include<stdio.h>
//int main(){
// float a;
// float b;
// printf("***Conversion of m^2 to ft^2 **** \n ");
// printf("please, type the area in m^2\n ");
// scanf("%f",&a);
// b=a/0.092903 ;
// printf("please, type the area in ft^2 =%0.2f ft^2 \n ", b);
// return 0;
//
//}
//Question 6
// #include<stdio.h>
//int main(){
// float a;
// float b;
// printf("***Conversion of km to miles **** \n ");
// printf("please, type the length in km\n ");
// scanf("%f",&a);
// b=a*0.621 ;
// printf("please, type the length in mile =%0.2f miles \n ", b);
// return 0;
//
//}
//Question 7
// #include<stdio.h>
//int main(){
// float a;
// float b;
// printf("***Conversion of ft^3 to m^3 **** \n ");
// printf("please, type the volume in ft^3\n ");
// scanf("%f",&a);
// b=a*0.0283 ;
// printf("please, type the volume in m^3 =%0.2f m^3 \n ", b);
// return 0;
//
//}

You might also like