Question:

For Loop problem in C++ ?

by  |  earlier

0 LIKES UnLike

hi there

I want to give a for loop in my programm that if any student fails in more than four subject he will not be able to go to the next level. if average is less than 40 then the student will be failed . i tried in many ways. but compiler is not taking at all. below i am just showing the logs for the loop but not the whole program. the program has got other parts. Basically i could not put the exact logic.

#include <stdio.h>

main()

{

int s,t;

Printf ("This student is not allowed to go to the next level as he fails in more than two subject\n");

scanf("%d",&s); /*here what will be the address of s ?*/

for (t=1, t>=4, t++)

}#include <stdio.h>

main()

{

int s,t;

Printf ("This student is not allowed to go to the next level as he fails in more than two subject\n");

scanf("%d",&s); /*here what will be the address of s ?*/

for (t=1, t>=4, t++)

}

 Tags:

   Report

1 ANSWERS


  1. in the for loop, wouldn&#039;t you put t&lt;=4, not t&gt;=4??  The for loop will never iterate otherwise.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.