write the programme for the following questions
Attachments:
Aishwarya98:
is my answer useful?
Answers
Answered by
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;
}
Similar questions