+ 2

Can someone help me with this code ???!

#include <stdio.h> #include <stdlib.h> int main(int argc,char *argv[]) { char ch; int i=0,p_count=0,f_count=0; for(i=0;i<5;i++) { printf("Enter the %dth result (p=pass , f=fail) : ",i+1); scanf("%c",ch); if(ch=='p') { p_count+=1; } if(ch=='f') { f_count+=1; } } printf("\n\n"); printf("The Entire result is :\n"); printf("\n\n"); // scanf("\\n"); printf("%d have passed \nand\n%d have failed \n",p_count,f_count); system("PAUSE"); }

11th Dec 2019, 2:43 PM
Ali Hosseinzadeh
Ali Hosseinzadeh - avatar
2 Answers
+ 4
put your code on code playground, then link it here, it will be easy to get help that way, and state whats wrong with your code
11th Dec 2019, 4:58 PM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 3
You did not specify what help you need.
11th Dec 2019, 3:45 PM
Ipang