Finding C programming hard? We’ve got you! 🚀Get 60% off on Programiz PRO Lifetime Plan this Black Friday-pay once for skills that last forever. Don’t miss out, it’s a limited-time offer! 👉Grab your discount now: bit.ly/blkfriday-24-yt
#include int main() { while (1) { int number; printf("Enter a number: "); scanf("%d", &number); if (number >= 0) { printf("Positive value"); break; } if (number % 2 == 0) { printf("Negative Even "); continue; } printf("%d ", number); } return 0; } I did in this way, and it is still working. However, in github the solution is written a slightly different. Is this code right?
Very well explained, this is what we're struggling when we're start coding as a beginner. Here the basics is covered well, and I'm really grateful for it. This eventually will help most of the enthusiastic learners.
//Can you write a prpgram that takes an input from the user and prints it if the value is a negative odd number? //*If the input value is positive, end the loop with message, 'Positive Value' //*If the input value is negative even, skip the value with message 'Negative Even' #include int main() { int number; while(1) { printf("Enter a number:"); scanf("%d", &number); if(number < 0) { if(number % 2 != 0) { printf("%d ", number); continue; } printf("Negative Even "); continue; } printf("Positive Value"); break; } }
@@itzmesuhail4948 this is the correct one int main() { while(1) { int number; printf("Enter a number:"); scanf("%d", &number); if (number > 0) { break; } if ((number % 3) != 0){ continue; } printf("%d ", number); } return 0; }
this has been a wonderful beginning to C, thank you so much!!! i think the answer is B. continue ? #include int main() { while(1){ int number; printf("Enter a Number: "); scanf("%d",&number); if(number>0){ printf("Positive Value "); break; } if((number%2)!= 0){ printf("%d ",number); continue; } printf("Negative Even "); } return 0; }
// Online C compiler to run C program online #include int main() { while(1){ int number; printf("Enter the number ="); scanf("%d",&number); if(number>0){ printf(" positive value"); break; } if((number% -2) ==0){ printf("negavtive even "); continue; } printf("%d ",number); } return 0; }
//A Program that takes input and prints if the value is a Negative odd number #include int main(){ while (1){ int number; printf("Enter a number: "); scanf("%d",&number); if (number>0) { printf("Positive Value"); break ; } if (number
QUIZ answer: continue PROGRAMMING TASK : #include #include /* Author - Aryan Phatarpekar Date - Sun 23 Oct 2022 */ main() { // declaring the variables int number;
while(1) { // asking user to enter the number printf("Enter a number "); scanf("%d", &number);
// checking the condition, if the number is greater than 0 priting the message it is a positive number & breaking the loop. if(number > 0) { printf("%d is a positive number, Please enter a a negative value ", number); break; }
/* if the number is less than 0(negative number) than making calculations on that number. dividing that number by 2 with modulus operator(%) and checking the remainder. remainder 0 means it is a -ve even number and continuing the code but remainder is 1 then it is a -ve odd and printing the message it is -ve odd number and breaking the loop. */ else { if(number < 0 && number % 2 == 0) { printf("%d is a negative even ", number); continue; }
else { printf("YES ! %d is negative Odd number ", number); break; } } } }
programming Task #include int main() { while(1){ int number; printf(" Enter a number:"); scanf("%d",&number); if(number>0){ printf("Positive Value"); continue; } if(number
programming task #include int main() { int number; printf("enter the number: "); scanf("%d", &number); if(number %2 = 1) { printf(" the value is postive"); } return 0; }
My answer: #include int main () { while (1){ sleep(2); int num; printf("Enter value of number: "); scanf("%d", &num); if ( num >=0 ) { printf("Positive value "); break; } if ( ( num % 2) == 0 ) { printf("Negative even "); continue; } printf("Negative odd number: %d ", num); } return 0; }
Task program of break and continue statement #include //Preprocesssor int main(){ // entry point while (1){ // for While conditions int number; // Declaration of variable printf ("Enter the number : "); // to print the number scanf ("%d", &number); if ( number >= 0){ // for If conditions printf ("Positive value "); break ; } if (( number % 2) >=0 ){ printf ("Negative Even "); continue ; } printf ("%d ", number); // To print the statements } return 0; }
#include int main() { while(1){ int number; printf("Enter number here:"); scanf("%d",&number); if(number>0){ printf("Positive Value "); break; } if(number%2==0){ printf("Negative Even "); continue; } printf("%d ",number); } return 0; } Quiz answer is B. continue
// Online C compiler to run C program online #include int sum = 0; int main() { while (1) { int number; printf("Enter a number: "); scanf("%d", &number); if (number < 0 && number % 2 != 0) { printf("%d ", number); } if (number < 0 && number % 2 == 0){ printf("Negative even "); continue; } if (number >= 0) { printf("positive value"); break; } } return 0; }
Hi, I like to print numbers 1 to 25 in five rows and 5 columns continuously and wish ‘22’ and ‘23’ to be skipped, using the ‘continue’ in a for loop as follows: #include #include int main() { int i,j,n=5; int x=1; for (i=1;i
Hey, I'm not sure if continue works in this case because you have to print something for the numbers 22 and 23 and if you skip them in the code you also skip the "x++" part. Here is what worked for me, hopefully you can modify it for your needs: //#define _CRT_SECURE_NO_WARNINGS //#include // //int main() //{ // int i, j, n = 5; // int x = 1; // for (i = 1; i
#include int main() { // Write C code here while(1){ int number; printf("Enter the number: "); scanf("%d", &number); if (number>0){ printf("possitive value"); break; } if (number
/*Can you write a program that takes an input from the user and prints it if the value is a negative odd number ? • If the input value is positive, end the loop with message, Positive Value. • If the input value is negative even, skip the value with message Negative Even.*/ while (1) { int num; printf("enter number: "); scanf_s("%d", &num); if (num > 0) { printf("Positive Value "); break; } else if (num == 0) { printf("Zero is not even or odd, loop continue "); continue; } else if (num % 2 == 0) { printf("Negative Even "); continue; }else printf("\t\t\t%d ",num); }
int main() { int x; while(1){ printf(" Enter a number : "); scanf("%d", &x); if (x>0){ printf("Positive Value"); break; } if (x%2 == 0){ printf("Negative even"); continue; } printf("Number %d",x); } return 0; }
#include int main(){ int i; while(1){ int i; printf(" Please type a value: "); scanf("%d", &i); if(i >= 0){ printf(" Positive Even "); break; } if(i < 0 && i % 2 != 0){ continue; } printf(" Negative Even "); } return 0; } I find this solution better because there would be no need for continue if you use else or else if
//Can you write a prpgram that takes an input from the user and prints it if the value is a negative odd number? //*If the input value is positive, end the loop with message, 'Positive Value' //*If the input value is negative even, skip the value with message 'Negative Even' #include int main(){ while (1) {
int number; printf("Enter a number: "); scanf("%d", &number); if(number < 0 && number%2 !=0){ printf("%d ", number); } else if(number < 0 && number%2 ==0){ printf("Negative Even "); }else{ printf("Positive Value "); break; } }
#include int main() { // Write C code here while(1){ int number; printf("enter number please"); scanf("%d",&number); if(number>0){ printf("posititive value "); }else if(number0){ break; } } return 0; }
Finding C programming hard? We’ve got you!
🚀Get 60% off on Programiz PRO Lifetime Plan this Black Friday-pay once for skills that last forever. Don’t miss out, it’s a limited-time offer!
👉Grab your discount now: bit.ly/blkfriday-24-yt
#include
int main() {
while (1) {
int number;
printf("Enter a number: ");
scanf("%d", &number);
if (number >= 0) {
printf("Positive value");
break;
}
if (number % 2 == 0) {
printf("Negative Even
");
continue;
}
printf("%d
", number);
}
return 0;
}
I did in this way, and it is still working. However, in github the solution is written a slightly different. Is this code right?
❤❤❤
no teacher at university explains these so well🖤🖤🖤
Very well explained, this is what we're struggling when we're start coding as a beginner. Here the basics is covered well, and I'm really grateful for it. This eventually will help most of the enthusiastic learners.
Q. Which of the following keywords is used to skip the current iteration of a loop ?
A. skip
B. continue
C. break
D. loop
break
Mam please tell me solution
Write a C program to add two number using static number ?
@@apurbabera9682 do some research or else drop the course.
Skip ?
B. continue
you and bro code might be the best coding teachers out there that can explain this 👍
//Can you write a prpgram that takes an input from the user and prints it if the value is a negative odd number?
//*If the input value is positive, end the loop with message, 'Positive Value'
//*If the input value is negative even, skip the value with message 'Negative Even'
#include
int main()
{
int number;
while(1)
{
printf("Enter a number:");
scanf("%d", &number);
if(number < 0)
{
if(number % 2 != 0)
{
printf("%d
", number);
continue;
}
printf("Negative Even
");
continue;
}
printf("Positive Value");
break;
}
}
thank you
by the way
at the the end
return 0;
@@devarapallivamsi2981 why while(1)
@@kothakotasrinivasarao5082 here, We need the loop to run without any condition(for the first time). So, we give while(1) which refers to True
wtf
Answer for Programming Task today
#include
int main(){
while(1){
int num;
printf("Enter a number:");
scanf("%d",&num);
if(num < 0){
if((num % 2) != 0){
printf("%d
",num);
}
else{
printf("Negatif Even
");
continue;
}
}
else{
printf("Positif value");
break;
}
}
return 0;
}
I think it wasn't correct plz check it
@@itzmesuhail4948
this is the correct one
int main()
{
while(1) {
int number;
printf("Enter a number:");
scanf("%d", &number);
if (number > 0) {
break;
}
if ((number % 3) != 0){
continue;
}
printf("%d
", number);
}
return 0;
}
@@shamsrahmantabish9299 Did you use the continue function?
Your explanations are simplified. Thank you!
this has been a wonderful beginning to C, thank you so much!!!
i think the answer is B. continue ?
#include
int main() {
while(1){
int number;
printf("Enter a Number: ");
scanf("%d",&number);
if(number>0){
printf("Positive Value
");
break;
}
if((number%2)!= 0){
printf("%d
",number);
continue;
}
printf("Negative Even
");
}
return 0;
}
thanks
this particular queestion came for my exams
Option B : Continue
-----------------------------------------------------------------------------------------
#include
int main ()
{
int num;
while (1)
{
printf("
Enter A Number : ");
scanf("%d", &num);
if (num < 0)
{
if (num % 2 == 0)
{
printf("Negative Even Number");
continue;
}
else
{
printf("%d", num);
}
}
else
{
printf("Positive Number");
break;
}
}
return 0;
}
09:29 Programming Task
#include
int main()
{
int i,j=0;
while(j
/*Improved version of your code,
Execute it to check*/
#include
int main()
{
label:
int i;
char choice;
printf("
Enter a value: ");
scanf("%d",&i);
if(i0)
{
if(i%2==0)
printf("Positive even number
");
else
printf("Positive odd number
");
}
else
{
printf("Neither be negitive or positive
");
}
printf("More numbers??
");
Label:
scanf(" %c", &choice);
if(choice=='y' || choice=='Y')
{
goto label;
}
else if(choice=='n' || choice=='N')
{
return 1;
}
else
{
printf("Answer in Y=Yes or N=No
");
goto Label;
}
return 0;
}
//Hello
Thank you for posting valuable content of C programming..
This was super helpful! Thank you.
// Online C compiler to run C program online
#include
int main() {
while(1){
int number;
printf("Enter the number =");
scanf("%d",&number);
if(number>0){
printf("
positive value");
break;
}
if((number% -2) ==0){
printf("negavtive even
");
continue;
}
printf("%d
",number);
}
return 0;
}
//A Program that takes input and prints if the value is a Negative odd number
#include
int main(){
while (1){
int number;
printf("Enter a number: ");
scanf("%d",&number);
if (number>0) {
printf("Positive Value");
break ;
}
if (number
These videos are very helpful. ThankYou!
amazing teacher🥰
great way of explanation , thanks a lot
This video is most valuble for programming beginners ❤️ can you do video for c programming functions ? 🌸😊
Our next video is on C Function. Do check it out on coming Wednesday. Thankyou for Watching !
QUIZ answer: continue
PROGRAMMING TASK :
#include
#include
/*
Author - Aryan Phatarpekar
Date - Sun 23 Oct 2022
*/
main()
{
// declaring the variables
int number;
while(1)
{
// asking user to enter the number
printf("Enter a number
");
scanf("%d", &number);
// checking the condition, if the number is greater than 0 priting the message it is a positive number & breaking the loop.
if(number > 0)
{
printf("%d is a positive number, Please enter a a negative value
", number);
break;
}
/*
if the number is less than 0(negative number) than making calculations on that number.
dividing that number by 2 with modulus operator(%) and checking the remainder.
remainder 0 means it is a -ve even number and continuing the code but remainder is 1 then it is a -ve odd and printing the message it is -ve odd number and breaking the loop.
*/
else
{
if(number < 0 && number % 2 == 0)
{
printf("%d is a negative even
", number);
continue;
}
else
{
printf("YES ! %d is negative Odd number
", number);
break;
}
}
}
}
Great video. Thank you
answer of quiz: Continue
programming Task
#include
int main() {
while(1){
int number;
printf("
Enter a number:");
scanf("%d",&number);
if(number>0){
printf("Positive Value");
continue;
}
if(number
programming task
#include
int main() {
int number;
printf("enter the number: ");
scanf("%d", &number);
if(number %2 = 1) {
printf("
the value is postive");
}
return 0;
}
thank you! this helped a lot
#include
int main() {
while (1) {
int number;
printf("Enter a number: ");
scanf("%d", &number);
if (number > 0) {
printf("Positive Value");
break;
}
if ((number % 2) ==0) {
printf("Negative Even
");
continue;
}
printf("%d
", number);
}
return 0;
}
PROGRAMIZ QUIZ ANSWER: B. continue
Videos are awesome as always 💖
Thankyou
Continue is usedd to skip the current iteration
My answer:
#include
int main ()
{
while (1){
sleep(2);
int num;
printf("Enter value of number:
");
scanf("%d", &num);
if ( num >=0 )
{
printf("Positive value
");
break;
}
if ( ( num % 2) == 0 )
{
printf("Negative even
");
continue;
}
printf("Negative odd number: %d
", num);
}
return 0;
}
programming task
#include
int main() {
while (1){
int number;
printf ("Enter a number: ");
scanf ("%d", &number);
if (number>0){
printf ("Positive Value
");
break;
}
if ((number % 2)== 0){
printf ("Negative Even
");
continue;
}
printf ("%d
", number);
}
return 0;
Thank you so much
thank you programiz team
//programming task
#include
int main()
{
while(1)
{
int num;
printf("input your num:");
scanf("%d", &num);
if(num>0)
{
printf("positive value");
break;
}
if((num %2) == 0)
{
printf("negative even
");
continue;
}
printf("your num is %d
", num);
}
return 0;
}
Task program of break and continue statement
#include //Preprocesssor
int main(){ // entry point
while (1){ // for While conditions
int number; // Declaration of variable
printf ("Enter the number : "); // to print the number
scanf ("%d", &number);
if ( number >= 0){ // for If conditions
printf ("Positive value
");
break ;
}
if (( number % 2) >=0 ){
printf ("Negative Even
");
continue ;
}
printf ("%d
", number); // To print the statements
}
return 0;
}
Good one
Thanks a lot guys for your sessions .... thanks @padma
thank you
9:34
#include
int main(void)
{
int a;
printf(“Enter number: “);
scanf(“%d”, &a);
If ( a < 0 && a % 2 == 1)
{
printf(“%d
”, a);
} else if (a > 0)
{
printf(“Positive Value.
”);
break;
} else if (a < 0 && a % 2 == 0)
{
printf(“Negative even.
”);
continue;
}
return (0);
}
She is sooooooo good
Great video 🔥🔥🔥
#include
int main() {
while(1){
int number;
printf("Enter number here:");
scanf("%d",&number);
if(number>0){
printf("Positive Value
");
break;
}
if(number%2==0){
printf("Negative Even
");
continue;
}
printf("%d
",number);
}
return 0;
}
Quiz answer is B. continue
Thanks ma'am
very very good 🤩
10:13 to skip current iteration only, not the whole loop, answer should be B.continue
Thank you 👍 answer is c
answer is b
Tq so much🙏🙏❤️❤️
answer:optiom B (mam)
// Online C compiler to run C program online
#include
int sum = 0;
int main() {
while (1) {
int number;
printf("Enter a number: ");
scanf("%d", &number);
if (number < 0 && number % 2 != 0) {
printf("%d
", number);
} if (number < 0 && number % 2 == 0){
printf("Negative even
");
continue;
} if (number >= 0) {
printf("positive value");
break;
}
}
return 0;
}
Thank you!!!
Thanks
opt B - continue
Hi, I like to print numbers 1 to 25 in five rows and 5 columns continuously and wish ‘22’ and ‘23’ to be skipped, using the ‘continue’ in a for loop as follows:
#include
#include
int main()
{
int i,j,n=5;
int x=1;
for (i=1;i
Hey, I'm not sure if continue works in this case because you have to print something for the numbers 22 and 23 and if you skip them in the code you also skip the "x++" part. Here is what worked for me, hopefully you can modify it for your needs:
//#define _CRT_SECURE_NO_WARNINGS
//#include
//
//int main()
//{
// int i, j, n = 5;
// int x = 1;
// for (i = 1; i
#include
int main()
{
int i,j;
int x=1;
for (i=1;i
Option B (continue)
Continue
Answer is B) continue
#include
int main () {
while (1) {
int number;
printf("
enter the number: ");
scanf("%d",&number);
if(number > 0) {
printf("
positive value");
break;
}
if((number%-2) ==0) {
printf("
negative even");
continue;
}
printf("%d
",number);
}
return 0;
}
PROGRAMMING TASK SOLUTION
int main() {
while (1) {
int number;
printf("Enter a number: ");
scanf("%d", &number);
if (number > 0) {
printf("Number is positive");
break;
}
if (number < 0 && number % -2 == 0) {
printf("Negative even
");
continue;
}
printf("%d
", number);
}
}
🔥🔥🔥🔥🔥
Answer:b
B is correct
option B continue
#include
int main() {
// Write C code here
while(1){
int number;
printf("Enter the number: ");
scanf("%d", &number);
if (number>0){
printf("possitive value");
break;
}
if (number
My Answer is B # continue
Hi Padma, unfortunately my code for printing positive numbers keeps saying number is undeclared yet it’s the same as yours
Break
B. Continue
Quiz: B
#include
int main() {
while(1){
int number;
printf("
enter a value:");
scanf("%d",&number);
if(number0){
printf("positive value");
break;
}
if(number
the answer is C, continue.
Programming task :-
#include
int main()
{
while (1)
{
int n;
printf("Enter any number: ");
scanf("%d", &n);
if (n >= 0)
{
printf("Positive value!
");
break;
}
if (n % 2 == 0)
{
printf("Negative even!
");
continue;
}
}
return 0;
}
1 #include
2 int main(void)
3 {
4 while (1)
5 {
6 int number;
7 printf("Enter the number: ");
8 scanf("%d", &number);
9 if (number > 0)
10 {
11 printf("Positive Value
");
12 break;
13 }
14 if (number < 0 && number % 2 == 0)
15 {
16 printf("Negative Even
");
17 continue;
18 }
19 else
20 {
21 printf("%d
", number);
22 }
23
24 }
25 return (0);
26 }
Perfect bro
❤❤❤
The Answer is B, Continue.
#include
int main() {
while(1){
int num;
printf("Enter a number:
");
scanf("%d", &num);
if (num > 0){
printf("Positive Value
");
break;
}
if (num %2== 0){
printf("Negative Even
");
continue;
}
printf("%d
", num);
}
return 0;
}
Ma'am at 5:53 in one place i=1 and other place i==3
For equal to two sign are used what's the reason ?
i=1 here ''='' is assignment operator..means in the box of i we are keeping value ''1''...i==1 means equating i with 1...hope this helps🙂
#include
int main() {
int number;
while (1) {
printf("Enter number value: ");
scanf("%d", &number);
if (number == 0) {
break;
}
if (number > 0) {
if (number % 2 == 0) {
printf("Positive even number
");
} else {
printf("Positive odd number
");
}
} else {
if (number % 2 == 0) {
printf("Negative even number
");
} else {
printf("Negative odd number
");
}
}
}
return 0;
}
while (1) {
int number ;
printf (" Enter a number : ") ;
scanf ("%d", &number) ;
if ( number > 0) {
printf(" Postive value ") ;
break ;
}
if ( number % 2 == 0) {
printf(" Negative even :
");
continue ;
}
if ( number % 2 != 0) {
printf(" Negative odd :
");
continue;
}
else printf("invalid number : %d
", number);
}
return 0 ;
}
/*Can you write a program that takes an input
from the user and prints it if the value is a
negative odd number ?
• If the input value is positive, end the loop with
message, Positive Value.
• If the input value is negative even, skip the
value with message Negative Even.*/
while (1) {
int num;
printf("enter number: ");
scanf_s("%d", &num);
if (num > 0) {
printf("Positive Value
");
break;
} else if (num == 0) {
printf("Zero is not even or odd, loop continue
");
continue;
} else if (num % 2 == 0) {
printf("Negative Even
");
continue;
}else
printf("\t\t\t%d
",num);
}
🙏🏽
answer is "B"
The answer is Continue..
Option b mam
while(1){
int number;
printf("Enter a number: ");
scanf("%d",&number);
if(number
The value of "CHEERIO" 🤣🤣🤣🤣🤣!!
answer is continue
int main() {
int x;
while(1){
printf("
Enter a number : ");
scanf("%d", &x);
if (x>0){
printf("Positive Value");
break;
}
if (x%2 == 0){
printf("Negative even");
continue;
}
printf("Number %d",x);
}
return 0;
}
#include
int main(){
int i;
while(1){
int i;
printf("
Please type a value: ");
scanf("%d", &i);
if(i >= 0){
printf("
Positive Even
");
break;
}
if(i < 0 && i % 2 != 0){
continue;
}
printf("
Negative Even
");
}
return 0;
}
I find this solution better because there would be no need for continue if you use else or else if
🤗🤗
//Can you write a prpgram that takes an input from the user and prints it if the value is a negative odd number?
//*If the input value is positive, end the loop with message, 'Positive Value'
//*If the input value is negative even, skip the value with message 'Negative Even'
#include
int main(){
while (1)
{
int number;
printf("Enter a number: ");
scanf("%d", &number);
if(number < 0 && number%2 !=0){
printf("%d
", number);
}
else if(number < 0 && number%2 ==0){
printf("Negative Even
");
}else{
printf("Positive Value
");
break;
}
}
return 0;
}
//Programiz quiz answer
B. continue
In 9:00 , do not write a float number 😅
#include
int main() {
// Write C code here
while(1){
int number;
printf("enter number please");
scanf("%d",&number);
if(number>0){
printf("posititive value
");
}else if(number0){
break;
}
}
return 0;
}
like 👍👍
answer is B.
B
My frnd tanusri made me shift from Jenny to Padma...Padma>>>>jenny
Same bro nenu kuda
int main() {
int number;
while (1){
printf("Enter a number: ");
scanf("%d", &number);
if (number > 0) {
printf("Positive Value
");
break;
} else if ((number % 2) == 0){
printf("Negative Even
");
continue;
}
else {
printf("%d
", number);
}
}
}
#include
using namespace std;
int main()
{
while (1)
{
int value;
cout > value;
if (value < 0 && value % 2 != 0)
{
cout
B.continue;