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 ; }
In this C program we will perform operations over Linear Queue ( i.e: Data insert Operation, Data remove Operation and display Operation ). The Choice( i.e: data insert,remove or display ) will be made by the user and The Number will be taken from the user( i.e: For Data insert Operation ). input: The Choice(i.e Data insert, remove or display) & The Number (integers) (i.e. for Data insert Operations) (15,10,128 etc.) output: The Operations will be excecuted as choosen by the user. CODE----> #include<stdio.h> #include<stdlib.h> #define MAXSIZE 10 int Q [ MAXSIZE ], front =- 1 , rear =- 1 ; void qinsert ( int x ) { if ( rear == MAXSIZE - 1 ) printf ( "\n Queue is Full." ); else if ( front ==- 1 ) { front = 0 ; rear = 0 ; Q [ front ]= x ; } else { rear ++; Q [ rear ]= x ; } } void qdelete () { if ( front ==- 1 ) printf ( "\n Queue is Empty." ); else if ( front == rear ) { printf ( "
Write a C program to print all natural numbers from 1 to n using for loop.
ReplyDeleteCode of given problem:
int main()
{
int i=1,n;
printf("Enter the number to print all natural number till that entered number\t");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("%d\t",i);
}
return 0;
}
Very informative blog!
Please take some time to visit my blog @
for loop program examples
Thanks!
Widcanpostga-1996 Dan Portwood https://marketplace.visualstudio.com/items?itemName=subdiber-ki.VIRTUAL-SOLDIERS-gratuita-2021
ReplyDeletevoilimentryt
OeritYerbiHuntsville Kimberly Vaughn https://www.iam-thatgirl.com/profile/Daemon408-139-X64rar-BETTER/profile
ReplyDeletebrimogistor
sisa0so-ku Kimberly Turner click here
ReplyDeletedownload
https://colab.research.google.com/drive/1ecWLNLSzduq_Rm6pRNjL-Gvef6W7Mg4p
download
adgravconse
words from f
ReplyDelete