Skip to main content

Posts

Lap Report of Rafi vai

1.Find the average of three numbers : #include<stdio.h> void main() { int a,b,c; printf("input the 1st number here : "); scanf("%d",&a); printf("input the 2nd number here : "); scanf("%d",&b); printf("input the 3rd number here : "); scanf("%d",&c); printf("average of three numbers = %d",(a+b+c)/3); } 2.Find the 2nd largest value from three input values : #include<stdio.h> void main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a==b&&b==c){ printf("They are Equal"); } else if(a>b && a<c || a>c && a<b){ printf("2nd largest :%d ",a); } else if(b>a && b<c || b>c && b<a){ printf("2nd largest :%d ",b); } else{ printf("2nd largest : %d",c); } } 3.Convert Celsius temperature into Fahrenheit : #include<stdio.h> void main() { in...

URI Online Judge | 1001

Extremely Basic Read 2 variables, named  A  and  B  and make the sum of these two variables, assigning its result to the variable  X . Print  X  as shown below. Print endline after the result otherwise you will get “ Presentation Error ”. Input The input file will contain 2 integer numbers. Output Print the letter  X  (uppercase) with a blank space before and after the equal signal followed by the value of X, according to the following example. Obs.: don't forget the endline after all. Samples Input Samples Output 10 9 X = 19 -10 4 X = -6 ANS: #include<stdio.h> int main() { int A,B,X; scanf("%d %d",&A,&B); X=A+B; printf("X = %d\n",X); return 0; }