Q. If sum of two integer is 14 and if one of them is 8 then find other integer. Ans: Well, this is very simple. Simply, one integer is 8 and sum of two integers is 14. So, we need to subtract the number 8 from their sum of 14 to get the second number. So, the second number is: 14 - 8 = 6 C-Program of this task Code---> #include<stdio.h> int main () { int num1 = 8 , num2 , sum = 14 ; num2 = sum - num1 ; printf ( "The second number is: %d" , num2 ); return 0 ; }
♠ Patterns in C-Language
- C-Program of Printing Half Pyramid using *(Asterisk)*
**
***
****
*****
- C-Program of Printing Half Pyramid using 123(Numbers)
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
- Half Pyramid Using ABC (alphabets) in C-language
A
AB
ABC
ABCD
ABCDE
- Inverted Half-Pyramid using Asterisk(*) in C-Language
*****
****
***
**
*
- A Pattern using Asterisk(*) in C-Language
----*► Here, - sign is used as Space for better understanding.
---**
--***
-****
*****
- Square made of asterisk(*) in C-Language
* * * * * * * * *
- Print the following pattern in C-Language using Asterisk(*)
***** **** *** ** *
- Print the following pattern in C-Language
1 2 3 4 5 6 7 8 9 10
Comments
Post a Comment