Computer Science, asked by abcd2703, 1 year ago

write the programme for the following questions

Attachments:

Aishwarya98: is my answer useful?
Aishwarya98: can you understand the logic behind those programs?
abcd2703: yes
abcd2703: thanks

Answers

Answered by Aishwarya98
0

1. #include<stdio.h>

#include<conio.h>

void main()

{

int num1,num2;

scanf("%d %d",&num1,&num2);

printf("sum=%d\nproduct:%d\nremainder:%d\n quotient:%d",num1+num2,num1*num2,num1%num2,num1/num2);

}

2. S.I = PNR /100;

get the values for principal, number of years, rate of interest using scanf("") function..

scanf("%d",&n); //n value is the last value of the range

sum_of_n_numbers = n*(n+1)/2

printf("%d",sum_of_n_numbers);


3. scanf("%d %d",&num1,&num2);

large=num1>num2?num1:num2;  //stores the largest value

printf("%d",large);


4. int main()

{

int a,b,temp;

scanf("%d",&a,&b);

temp=a;

a=b;

b=temp;

printf("%d %d",a,b); //the numbers will be interchanged

return 0;

}


abcd2703: why am I troubling u
abcd2703: I am so sorry
abcd2703: I got fever so I didn't want to my class so I don't know how to do this
abcd2703: tomorrow I have exam
abcd2703: that's why
Aishwarya98: oh...okay..sorry
abcd2703: it's ok
abcd2703: mistake is on me only
abcd2703: I should not trouble u like this
abcd2703: I am sorry
Similar questions